//This version of script is for use with PVD versions 0.9.9.16 and above!!! (* Additional types and functions that can be used in scripts: --------------------------------------------- SCRIPT: iafd_movie script AUTHOR: SusiMeier DATE: 20/6/2010 VERSION: 0.0.1.3 CO-AUTHOR: Ivek23 SCRIPT MODIFICATION: Ivek23 MODIFICATION VERSION: 0.3.0.0 DATE: 29/12/2014 UPDATE: 21/05/2015 --------------------------------------------- CustomField : IAFDUpdated ----> Long Text Comments ----> Memo AKA ----> Memo Studio ----> Select List OR Multiselect List Distributor ----> Select List OR Multiselect List Studio (Distributor) ----> Memo Compilation ----> Select List OR Multiselect List Magazine Reviews ----> Memo Buy This Movie ----> Memo DVD Bonus ----> Checkbox Complete Movie ----> Checkbox //IAFD Duration ----> Short Text --------------------------------------------- //Types TWIDEARRAY : array of String //Field functions procedure AddSearchResult(Title1, Title2, Year, URL, PreviewURL : String) procedure AddFieldValue(AField: Integer; AValue : String) procedure AddMoviePerson(Name, TransName, Role, URL : String; AType : Byte) procedure AddPersonMovie(Title, OrigTitle, Role, Year, URL : String; AType : Byte) procedure AddAward(Event, Award, Category, Recipient, Year: String; const Won : Boolean) procedure AddConnection(Title, OrigTitle, Category, URL, Year: String) procedure AddEpisode(Title, OrigTitle, Description, URL, Year, Season, Episode : String) //String functions function Pos(Substr : String; Str: String): Integer function PosFrom(const SubStr, Str : String; FromIndex : Integer) : Integer function LastPos(const SubStr, Str : String) : Integer function PrevPos(const SubStr, Str : String; APos : Integer) : Integer function RemoveTags(AText : String; doLineBreaks : Boolean) : String function ExplodeString(AText : String; var Items : TWideArray; Delimiters : String) : Integer function Copy(S: String; Index, Count: Integer): String procedure Delete(var S: String; Index, Count: Integer) procedure Insert(Source: String; var Dest: String; Index: Integer) function Length(S: String): Integer function Trim(S: String): String function CompareText(S1, S2: String): Integer function CompareStr(S1, S2: String): Integer function UpperCase(S: String): String function LowerCase(S: String): String function StringReplace(S, OldPattern, NewPattern: String; ReplaceAll : Boolean; IgnoreCase : Boolean; WholeWord: Boolean): String function StrToInt(const S: String): Integer function IntToStr(const Value: Integer): String function StrToFloat(const S: String): Extended function FloatToStr(const Value: Extended): String function HTMLValues(const HTML : String; ABegin, AEnd, ItemBegin, ItemEnd : String; ValDelim : String; var Pos : Integer) : String function HTMLValues2(const HTML : String; ABegin, AEnd, ItemBegin, ItemEnd : String; ValDelim : String; var Pos : Integer) : String function TextBetween(const HTML : String; ABegin, AEnd : String; doLineBreaks : Boolean; var Pos : Integer) : String function HTMLToText(const HTML : String) : String procedure ShowMessage(const Msg, Head : String) *) const pauseBeforeLoad = 1000; // Pause before loading (in millisecond) //Some useful constants const //Script types stMovies = 0; stPeople = 1; stPoster = 2; //Script modes smSearch = 0; smNormal = 1; smPoster = 2; //Parse results prError = 0; prFinished = 1; prList = 2; prListImage = 3; prDownload = 4; //Movie fields mfURL = 0; mfTitle = 1; mfOrigTitle = 2; mfAka = 3; mfYear = 4; mfGenre = 5; mfCategory = 6; mfCountry = 7; mfStudio = 8; mfMPAA = 9; mfRating = 10; mfTags = 11; mfTagline = 12; mfDescription = 13; mfDuration = 14; mfFeatures = 15; //People fields pfURL = 0; pfName = 1; pfTransName = 2; pfAltNames = 3; pfBirthday = 4; pfBirthplace = 5; pfGenre = 6; pfBio = 7; pfDeathDate = 8; //Credits types ctActors = 0; ctDirectors = 1; ctWriters = 2; ctComposers = 3; ctProducers = 4; //Script data SCRIPT_VERSION = '0.3.0.0'; SCRIPT_NAME = 'IAFD.com_movie'; SCRIPT_DESC = '[EN] Get movie full information from IAFD.com'; SCRIPT_LANG = $09; //English SCRIPT_TYPE = stMovies; BASE_URL = 'http://www.iafd.com/'; RATING_NAME = 'ADE'; SEARCH_STR = 'www.iafd.com/results.asp?SearchType=Mozilla-search&SearchString=%s'; CODE_PAGE = 0; //Use 0 for Autodetect //Custom field names to use BONUS_FIELD = 'DVD Bonus'; COMPLETE_FIELD = 'Complete Movie'; //Global variables var Mode : Byte; PosterURL : String; //Functions function GetScriptVersion : String; begin Result := SCRIPT_VERSION; end; function GetScriptName : String; begin Result := SCRIPT_NAME; end; function GetScriptDesc : String; begin Result := SCRIPT_DESC; end; function GetRatingName : String; begin Result := RATING_NAME; end; function GetScriptLang: Cardinal; begin Result := SCRIPT_LANG; end; function GetCodePage : Cardinal; begin Result := CODE_PAGE; end; function GetBaseURL : AnsiString; begin Result := BASE_URL; end; function GetDownloadURL : AnsiString; begin if PosterURL = '' then Result := SEARCH_STR else Result := PosterURL; end; function GetScriptType : Byte; begin Result := SCRIPT_TYPE; end; function GetCurrentMode : Byte; begin Result := Mode; end; function HTMLValue(HTML: string; StartPos, EndPos: Integer; StartValue, EndValue: string): string; var ValueStart, ValueEnd: Integer; begin ValueStart := PosFrom(StartValue, HTML, StartPos); if (ValueStart > 0) and ((ValueStart < EndPos) or (EndPos = 0)) then begin ValueStart := ValueStart + Length(StartValue); ValueEnd := PosFrom(EndValue, HTML, ValueStart); Result := Copy(HTML, ValueStart, ValueEnd - ValueStart); end else Result := ''; end; function RemoveTagsEx(AText : String) : String; var B, E : Integer; begin Result := AText; B := PosFrom('(', Result, 1); E := PosFrom(')', Result, B); while (B > 0) AND (B < E) do begin Delete(Result, B, E - B + 1); B := Pos('(', Result); E := Pos(')', Result); end; end; function RemoveTagsEx1(AText : String) : String; var B, E : Integer; begin Result := AText; B := PosFrom('(', Result, 1); E := PosFrom(']', Result, B); while (B > 0) AND (B < E) do begin Delete(Result, B, E - B + 1); B := Pos('(', Result); E := Pos(']', Result); end; end; function RemoveTagsEx2(AText : String) : String; var B, E : Integer; begin Result := AText; B := PosFrom('copyright">', Result, 1); E := PosFrom('', Result, B); while (B > 0) AND (B < E) do begin Delete(Result, B, E - B + 1); B := Pos('copyright">', Result); E := Pos('', Result); end; end; //procedure FindPoster(HTML : String); //var // curPos, EndPos : Integer; //begin // curPos := Pos('Box Cover', HTML); // curPos := PosFrom(' '' then begin ExplodeString(Date, DateParts, '-'); Date := DateParts[2] +'.'+ DateParts[1] +'.'+ DateParts[0]; Date := StringReplace(Date, '01.', '1.', True, True, False); Date := StringReplace(Date, '02.', '2.', True, True, False); Date := StringReplace(Date, '03.', '3.', True, True, False); Date := StringReplace(Date, '04.', '4.', True, True, False); Date := StringReplace(Date, '05.', '5.', True, True, False); Date := StringReplace(Date, '06.', '6.', True, True, False); Date := StringReplace(Date, '07.', '7.', True, True, False); Date := StringReplace(Date, '08.', '8.', True, True, False); Date := StringReplace(Date, '09.', '9.', True, True, False); //AddCustomFieldValueByName('IAFDUpdated', Date); // Simple //AddCustomFieldValueByName('IAFDUpdated', DateToStr(CurrentDateTime) + ' at ' + TimeToStr(CurrentDateTime)); // Verbose AddCustomFieldValueByName('IAFDUpdated', Date + ' at ' + TimeToStr(CurrentDateTime) + ' '+#8226+' ' + SCRIPT_NAME + ' ' + SCRIPT_VERSION); // Annoying end else LogMessage('date not found'); AddFieldValue(mfGenre, 'IAFD'); AddFieldValue(mfURL, MovieURL); LogMessage('Page parsing started'); EndPos := 1; fullinfo:= ''; fullinfo:= fullinfo + + #13#10; //Check for title. No orig. title info present, so duplicate.. dbgstrg:= TextBetween(HTML, '

', '(', False, EndPos); LogMessage('Title: ' + dbgstrg); AddFieldValue(mfOrigTitle,dbgstrg); AddFieldValue(mfTitle,dbgstrg); // Year dbgstrg:= Trim(TextBetween(HTML, '(', ')', False, EndPos)); LogMessage('YEAR:' + dbgstrg); AddFieldValue(mfYear,dbgstrg); // AKA - Titles... LogMessage('getting all titles'); curPos := Pos('
Also Known As', HTML); if curPos>0 then begin curPos := PosFrom('Also Known As
', HTML,curPos)+22; EndPos := PosFrom('
',HTML,curPos); dbgstrg:= Trim(Copy(HTML,curPos ,(EndPos-curPos))); dbgstrg := StringReplace(dbgstrg,'
','
',true,true,true); dbgstrg := StringReplace(dbgstrg,'
','',true,true,true); AddCustomFieldValueByName('AKA',dbgstrg); dbgstrg0:= Trim(Copy(HTML,curPos ,(EndPos-curPos))); dbgstrg0 := StringReplace(dbgstrg0,'
','',true,true,true); dbgstrg0 := StringReplace(dbgstrg0,'
','
',true,true,true); dbgstrg0 := StringReplace(dbgstrg0,'
','',true,true,true); dbgstrg0 := RemoveTagsEx(dbgstrg0); dbgstrg0 := RemoveTagsEx1(dbgstrg0); AddFieldValue(mfAka,dbgstrg0); Tags := ''; if Pos('3D version',dbgstrg) > 0 then Tags := Tags+', '+'3D version'; dbgstrg := StringReplace(dbgstrg,'3D version','',true,false,true); if Pos('alternative theatrical title',dbgstrg) > 0 then Tags := Tags+', '+'alternative theatrical title'; dbgstrg := StringReplace(dbgstrg,'alternative theatrical title','',true,false,true); if Pos('alternative title', dbgstrg) > 0 then Tags := Tags+', '+'alternative title'; dbgstrg := StringReplace(dbgstrg,'alternative title','',true,false,true); if Pos('alternate',dbgstrg) > 0 then Tags := Tags+', '+'alternate'; dbgstrg := StringReplace(dbgstrg,'alternate','',true,false,true); if Pos('DVD box cover',dbgstrg) > 0 then Tags := Tags+', '+'DVD box cover'; dbgstrg := StringReplace(dbgstrg,'DVD box cover','',true,false,true); if Pos('VHS box cover',dbgstrg) > 0 then Tags := Tags+', '+'VHS box cover'; dbgstrg := StringReplace(dbgstrg,'VHS box cover','',true,false,true); if Pos('box cover title',dbgstrg) > 0 then Tags := Tags+', '+'box cover title'; dbgstrg := StringReplace(dbgstrg,'box cover title','',true,false,true); if Pos('DVD cover title',dbgstrg) > 0 then Tags := Tags+', '+'DVD cover title'; dbgstrg := StringReplace(dbgstrg,'DVD cover title','',true,false,true); if Pos('VHS cover title',dbgstrg) > 0 then Tags := Tags+', '+'VHS cover title'; dbgstrg := StringReplace(dbgstrg,'VHS cover title','',true,false,true); if Pos('boxcover',dbgstrg) > 0 then Tags := Tags+', '+'boxcover'; dbgstrg := StringReplace(dbgstrg,'boxcover','',true,false,true); if Pos('box cover',dbgstrg) > 0 then Tags := Tags+', '+'box cover'; dbgstrg := StringReplace(dbgstrg,'box cover','',true,false,true); if Pos('cable version',dbgstrg) > 0 then Tags := Tags+', '+'cable version'; dbgstrg := StringReplace(dbgstrg,'cable version','',true,false,true); if Pos('cover title',dbgstrg) > 0 then Tags := Tags+', '+'cover title'; dbgstrg := StringReplace(dbgstrg,'cover title','',true,false,true); if Pos('DVD re-issue',dbgstrg) > 0 then Tags := Tags+', '+'DVD re-issue'; dbgstrg := StringReplace(dbgstrg,'DVD re-issue','',true,false,true); if Pos('DVD reissue',dbgstrg) > 0 then Tags := Tags+', '+'DVD reissue'; dbgstrg := StringReplace(dbgstrg,'DVD reissue','',true,false,true); if Pos('DVD re-release',dbgstrg) > 0 then Tags := Tags+', '+'DVD re-release'; dbgstrg := StringReplace(dbgstrg,'DVD re-release','',true,false,true); if Pos('DVD release',dbgstrg) > 0 then Tags := Tags+', '+'DVD release'; dbgstrg := StringReplace(dbgstrg,'DVD release','',true,false,true); if Pos('DVD Video',dbgstrg) > 0 then Tags := Tags+', '+'DVD Video'; dbgstrg := StringReplace(dbgstrg,'DVD Video','',true,false,true); if Pos('DVD version',dbgstrg) > 0 then Tags := Tags+', '+'DVD version'; dbgstrg := StringReplace(dbgstrg,'DVD version','',true,false,true); if Pos('international title',dbgstrg) > 0 then Tags := Tags+', '+'international title'; dbgstrg := StringReplace(dbgstrg,'international title','',true,false,true); if Pos('original distributed by',dbgstrg) > 0 then Tags := Tags+', '+'original distributed by'; dbgstrg := StringReplace(dbgstrg,'original distributed by','',true,false,true); if Pos('original VHS title',dbgstrg) > 0 then Tags := Tags+', '+'original VHS title'; dbgstrg := StringReplace(dbgstrg,'original VHS title','',true,false,true); if Pos('original soft version',dbgstrg) > 0 then Tags := Tags+', '+'original soft version'; dbgstrg := StringReplace(dbgstrg,'original soft version','',true,false,true); if Pos('original title',dbgstrg) > 0 then Tags := Tags+', '+'original title'; dbgstrg := StringReplace(dbgstrg,'original title','',true,false,true); if Pos('original released by',dbgstrg) > 0 then Tags := Tags+', '+'original released by'; dbgstrg := StringReplace(dbgstrg,'original released by','',true,false,true); if Pos('original release by',dbgstrg) > 0 then Tags := Tags+', '+'original release by'; dbgstrg := StringReplace(dbgstrg,'original release by','',true,false, true); if Pos('original',dbgstrg) > 0 then Tags := Tags+', '+'original'; dbgstrg := StringReplace(dbgstrg,'original','',true,false,true); if Pos('on screen-title',dbgstrg) > 0 then Tags := Tags+', '+'on screen-title'; dbgstrg := StringReplace(dbgstrg,'on screen-title','',true,false,true); if Pos('on-screen title',dbgstrg) > 0 then Tags := Tags+', '+'on-screen title'; dbgstrg := StringReplace(dbgstrg,'on-screen title','',true,false,true); if Pos('on screen title',dbgstrg) > 0 then Tags := Tags+', '+'on screen title'; dbgstrg := StringReplace(dbgstrg,'on screen title','',true,false,true); if Pos('on.screen',dbgstrg) > 0 then Tags := Tags+', '+'on screen'; dbgstrg := StringReplace(dbgstrg,'on.screen','',true,false,true); if Pos('on screen',dbgstrg) > 0 then Tags := Tags+', '+'on screen'; dbgstrg := StringReplace(dbgstrg,'on screen','',true,false,true); if Pos('re-issue',dbgstrg) > 0 then Tags := Tags+', '+'re-issue'; dbgstrg := StringReplace(dbgstrg,'re-issue','',true,false,true); if Pos('re-released by',dbgstrg) > 0 then Tags := Tags+', '+'re-released by'; dbgstrg := StringReplace(dbgstrg,'re-released by','',true,false,true); if Pos('re-release',dbgstrg) > 0 then Tags := Tags+', '+'re-release'; dbgstrg := StringReplace(dbgstrg,'re-release','',true,false,true); if Pos('released by',dbgstrg) > 0 then Tags := Tags+', '+'released by'; dbgstrg := StringReplace(dbgstrg,'released by','',true,false,true); if Pos('release by',dbgstrg) > 0 then Tags := Tags+', '+'release by'; dbgstrg := StringReplace(dbgstrg,'release by','',true,false,true); if Pos('video release',dbgstrg) > 0 then Tags := Tags+', '+'video release'; dbgstrg := StringReplace(dbgstrg, 'video release','',true,false,true); if Pos('release',dbgstrg) > 0 then Tags := Tags+', '+'release'; dbgstrg := StringReplace(dbgstrg,'release','',true,false,true); if Pos('shorter version',dbgstrg) > 0 then Tags := Tags+', '+'shorter version'; dbgstrg := StringReplace(dbgstrg,'shorter version','',true,false,true); if Pos('softcore version',dbgstrg) > 0 then Tags := Tags+', '+'softcore version'; dbgstrg := StringReplace(dbgstrg,'softcore version','',true,false,true); if Pos('softcore',dbgstrg) > 0 then Tags := Tags+', '+'softcore'; dbgstrg := StringReplace(dbgstrg,'softcore','',true,false,true); if Pos('title',dbgstrg) > 0 then Tags := Tags+', '+'title'; dbgstrg := StringReplace(dbgstrg,'title','',true,false,true); if Pos('VHS version',dbgstrg) > 0 then Tags := Tags+', '+'VHS version'; dbgstrg := StringReplace(dbgstrg,'VHS version','',true,false,true); dbgstrg := StringReplace(dbgstrg,'Perversion','',true,false,true); dbgstrg := StringReplace(dbgstrg,'perversions','',true,false,true); if Pos('version',dbgstrg) > 0 then Tags := Tags+', '+'version'; dbgstrg := StringReplace(dbgstrg,'version','',true,false,true); if Pos('VHS tape',dbgstrg) > 0 then Tags := Tags+', '+'VHS tape'; dbgstrg := StringReplace(dbgstrg,'VHS tape','',true,false,true); if Tags <> '' then AddFieldValueXML('tags',Tags); Countries := ''; dbgstrg := StringReplace(dbgstrg,'European','',true,false,true); dbgstrg := StringReplace(dbgstrg,'Europe ','',true,false,true); if Pos('Europe',dbgstrg) > 0 then Countries := Countries+'Europe, '; dbgstrg := StringReplace(dbgstrg,'Europe','',true,false,true); if Pos('Germany',dbgstrg) > 0 then Countries := Countries+'Germany, '; dbgstrg := StringReplace(dbgstrg,'Germany','',true,false,true); dbgstrg := StringReplace(dbgstrg,'Francesco','',true,false,true); dbgstrg := StringReplace(dbgstrg,'Alpha France','',true,false,true); if Pos('France',dbgstrg) > 0 then Countries := Countries+'France, '; dbgstrg := StringReplace(dbgstrg,'France','',true,false,true); if Pos('Italy',dbgstrg) > 0 then Countries := Countries+'Italy, '; dbgstrg := StringReplace(dbgstrg,'Italy','',true,false,true); if Pos('Spain',dbgstrg) > 0 then Countries := Countries+'Spain, '; dbgstrg := StringReplace(dbgstrg,'Spain','',true,false,true); if Pos('UK',dbgstrg) > 0 then Countries := Countries+'UK, '; dbgstrg := StringReplace(dbgstrg,'UK','',true,false,true); if Pos('USA',dbgstrg) > 0 then Countries := Countries+'USA, '; dbgstrg := StringReplace(dbgstrg,'USA','',true,false,true); if Countries <> '' then AddFieldValueXML('country',Countries); //Category if Pos('softcore', dbgstrg) > 0 then Category := Category + 'Softcore'; if Category <> '' then AddFieldValueXML('category',Category); end; // Studio //
VTO (VTO)
curPos := PosFrom(' 0 then Studio := TextBetween(HTML, '>', '', False, curPos) else curPos := EndPos; Studio := StringReplace(Studio, 'Unknown', '', true, false, true); AddCustomFieldValueByName('Studio', Studio); // Studio //
VTO (VTO)
curPos := PosFrom('
Studio (Distributor)
', HTML, EndPos); if curPos > 0 then AddFieldValue(mfStudio, TextBetween(HTML, '">', ' ', False, curPos)) else curPos := EndPos; curPos := PosFrom('
Studio (Distributor)
', HTML, EndPos); if curPos > 0 then Studio2 := TextBetween(HTML, '', +'">', true, false, true); Studio2 := StringReplace(Studio2, '', true, false, true); Studio2 := StringReplace(Studio2, 'Distributor ', '', true, false, true); Studio2 := StringReplace(Studio2, '', '', true, false, true); if Studio2 <> '' then Studio2 := Studio2 else Studio2 := ''; //if Studio2 <> '' then AddCustomFieldValueByName('Studio1', Studio2); // Distributor // Same Code as for an actor curPos := Pos('
Studio (Distributor)
', HTML); if curPos>0 then begin // get url Curpos := Posfrom('
', HTML, Curpos); //URL := BASE_URL + '/' + Trim(Copy(HTML, Curpos+9, Endpos- Curpos-9)); URL := BASE_URL + Trim(Copy(HTML, Curpos+10, Endpos- Curpos-10)); LogMessage(URL); // Get Name Curpos := Posfrom('">', HTML, Curpos)+2; Endpos := PosFrom(')', HTML, Curpos); if (curPos > 0) then begin Name := Trim(Copy(HTML, curPos, (endPos-curPos))); Name := StringReplace(Name, '/', '-', true, false, true); LogMessage(Name); debug_pos1:=Pos('(',Name); if debug_pos1 >0 then Name := Copy(Name,0,debug_pos1-1); LogMessage(Name); //AddMoviePerson(Trim(Name), '', '', URL, ctDirectors); Where to store? AddCustomFieldValueByName('Distributor',Name); Distributor := '' + Name + ''; if Distributor <> '' then Distributor := Distributor else Distributor := ''; curPos := PosFrom('', HTML, curPos); // search for url start; actPosEnd:=PosFrom('', HTML, actPosStart); // search for url end if (actPosStart > 0) then begin Name := Trim(Copy(HTML, (actPosStart + Length('.htm">')), (actPosEnd - actPosStart - 6) )); Name := StringReplace(Name, '/', '-', true, false, true); LogMessage(Name); debug_pos1:=Pos('(',Name); if debug_pos1 >0 then Name := Copy(Name,0,debug_pos1-1); LogMessage(Name); //AddMoviePerson(Trim(Name), '', '', URL, ctDirectors); Where to store? AddCustomFieldValueByName('Distributor',Name); Distributor1 := '' + Name + ''; if Distributor1 <> '' then Distributor1 := Distributor1 else Distributor1 := ''; AddCustomFieldValueByName('Studio (Distributor)', 'Distributor : ' + Distributor1); curPos := PosFrom('href="', HTML, Curpos); end; end; // Director // Same Code as for an actor curPos := Pos('
Director
', HTML); if curPos>0 then begin EndPos := curPos; while (curPos > 0) AND (curPos < PosFrom('
Minutes
', HTML, EndPos)) do begin EndPos := curPos; // Set last position to actual position // get url UrlPosStart := PosFrom('href=', HTML, curPos); // search for url start UrlPosEnd := PosFrom('>', HTML, UrlPosStart); // search for url start URL := BASE_URL + '/' + Trim(Copy(HTML, UrlPosStart + 7, (UrlPosEnd - UrlPosStart - 8) )); LogMessage(URL); // Get Name actPosStart:=PosFrom('.htm">', HTML, curPos); // search for url start; actPosEnd:=PosFrom('', HTML, actPosStart); // search for url end if (actPosStart > 0) then begin Name := Trim(Copy(HTML, (actPosStart + Length('.htm">')), (actPosEnd - actPosStart - 6) )); LogMessage(Name); debug_pos1:=Pos('(',Name); if debug_pos1 >0 then Name := Copy(Name,0,debug_pos1-1); LogMessage(Name); AddMoviePerson(Trim(Name), '', '', LowerCase(URL), ctDirectors); curPos := PosFrom('href="', HTML, actPosEnd); end; end; end; // Cast curPos := Pos('

Actresses

', HTML); LogMessage('Cast readout'); if curPos > 0 then begin EndPos := curPos; while (curPos > 0) AND (curPos < PosFrom('
', HTML, UrlPosStart); // search for url end URL := BASE_URL + Trim(Copy(HTML, UrlPosStart + 6, (UrlPosEnd - UrlPosStart - 7) )); LogMessage(URL); // Get Name actPosStart:=PosFrom('.htm">', HTML, EndPos); // search for url start; actPosEnd:=PosFrom('', HTML, actPosStart); // search for url end Name := Trim(Copy(HTML, (actPosStart + Length('.htm">')), (actPosEnd - actPosStart - 6) )); LogMessage(Name); debug_pos1:=Pos('(',Name); if debug_pos1 >0 then Name := Copy(Name,0,debug_pos1-1); LogMessage(Name); AddMoviePerson(Trim(Name), '', '', LowerCase(URL), ctActors); curPos := PosFrom('href="', HTML, actPosEnd); end; end; //Compilation CurPos:= Pos('
Compilation
',HTML); if curPos > 0 then begin EndPos := CurPos; curPos := PosFrom('
', HTML, curPos)+4; EndPos := PosFrom('
Director
', HTML, curPos); dbgstrg := Copy(HTML, curPos, EndPos - curPos); if Pos('Yes', dbgstrg) > 0 then Compilation := Compilation + 'Yes'; dbgstrg := StringReplace(dbgstrg, 'Yes', '', true, false, true); AddCustomFieldValueByName('Compilation', Compilation); if Compilation <> '' then Compilation := #32#32#32#32#32#32#32#32#32#32 + 'Compilation : ' + Compilation else Compilation := Compilation; end; // Minutes CurPos:= Pos('
Minutes
',HTML); if curPos > 0 then begin //EndPos := CurPos; curPos := PosFrom('
', HTML, curPos)+4; EndPos := PosFrom('
', HTML, curPos); Duration := IntToStr(StrToInt(Copy(HTML, curPos, EndPos - curPos)) * 60); if Duration <> '' then AddFieldValueXML('length',Duration); end else LogMessage('length not found'); Duration1 := Copy(HTML, curPos, EndPos - curPos); Duration1 := StringReplace(Duration1, 'No Data', '', true, false, true); if Duration1 <> '' then Duration1 := 'Runtime : ' + Duration1 + ' Min.' else Duration1 := Duration1; if (Duration1 = '') AND (Compilation <> '') then fullinfo:= fullinfo + Compilation + #13#10; if (Duration1 <> '') AND (Compilation = '') then fullinfo:= fullinfo + Duration1 + #13#10; if (Duration1 <> '') AND (Compilation <> '') then fullinfo:= fullinfo + Duration1 + Compilation + #13#10; //end; // Complete Movie If Pos('
', HTML) > 0 then begin tmpstrg2 := TextBetween(HTML, '" title="This title is verified as being complete and correct." src="/graphics/', '.gif"', True, curPos); //if Pos('complete', tmpstrg2) > 0 then tmpstrg1 := tmpstrg1 + 'Yes'; // tmpstrg3 := StringReplace(tmpstrg2, 'complete', '', true, false, true); // AddCustomFieldValueByName('IAFD Complete Movie', tmpstrg2); if PosFrom('complete', tmpstrg2, 1) > 0 then AddCustomFieldValueByName(COMPLETE_FIELD, '-1'); end; // Comments If Pos('

Comments

', HTML) > 0 then begin curPos := Pos('

Comments

', HTML); EndPos := curPos; dbgstrg0 := HTMLValues(HTML, '
', 'DVD Bonus.', '', '
', EndPos); EndPos := curPos; curPos := PosFrom('DVD Bonus.', HTML, EndPos+18); dbgstrg4 := ''; while (curPos > 0) AND (curPos < PosFrom('', HTML, EndPos+18)) do begin // G actPosStart:=PosFrom('DVD Bonus.', HTML, curPos); // search for url start; actPosEnd:=PosFrom('/li>', HTML, actPosStart); // search for url end Name2 := Trim (Copy(HTML, actPosStart,actPosEnd - actPosStart)); LogMessage(Name2); // remove static text from string (DVD Bonus.) and split cleaned string by ',' tmpstrg1 := Copy(Name2,4,1000); ActorNumber := ExplodeString(tmpstrg1, ActorNames,','); LogMessage(tmpstrg1); // Prepare first part of string... //dbgstrg4:= dbgstrg4 + #13#10 + ' DVD Bonus: '; //dbgstrg4:= dbgstrg4 + #13#10 + ' '; dbgstrg4:= dbgstrg4; // format splitted strings into links For I := Low (ActorNames) To High (ActorNames) Do begin dbgstrg4 := dbgstrg4 + '' + ActorNames[I] + ' '; dbgstrg4 := StringReplace(dbgstrg4, '<">', '">', true, false, true); //dbgstrg4 := StringReplace(dbgstrg4, '< ', ''+#13#10+' ', true, false, true); dbgstrg4 := StringReplace(dbgstrg4, '< ', ''+#13#10, true, false, true); dbgstrg4 := StringReplace(dbgstrg4, '">DVD Bonus. ', '">', true, false, true); dbgstrg4 := StringReplace(dbgstrg4, 'DVD Bonus.', HTML, actPosEnd); end; if (dbgstrg4 = '') AND (dbgstrg <> '') then AddFieldValue(mfTagline,dbgstrg); if (dbgstrg4 <> '') AND (dbgstrg = '') then AddFieldValue(mfTagline, dbgstrg4); if (dbgstrg4 <> '') AND (dbgstrg <> '') then AddFieldValue(mfTagline, dbgstrg + dbgstrg4); //AddFieldValue(mfTagline, dbgstrg + ' '+#8226+' DVD Bonus : ' + dbgstrg4); // DVD Bonus if PosFrom('DVD Bonus', dbgstrg4, 1) > 0 then AddCustomFieldValueByName(BONUS_FIELD, '-1'); end; // Magazine Reviews //dbgstrg2 := HTMLValue(HTML, Pos('

Magazine Reviews

', HTML), 0, '

', '
'); dbgstrg2 := HTMLValues2(HTML, '

Magazine Reviews

', '', '', // #13, EndPos); #13#160#160#160#160#9679#160#160, EndPos); if dbgstrg2 <> '' then begin dbgstrg2 := StringReplace(dbgstrg2, ': ', #160#160#8226#160#160, true, true, true); dbgstrg2 := StringReplace(dbgstrg2, ':', #160#160#8226#160#160, true, true, true); dbgstrg2 := #160#160#160#160#9679#160#160+dbgstrg2; dbgstrg2 := dbgstrg2; //LogMessage('dbgstrg2: '+ dbgstrg2); //AddCustomFieldValueByName('Magazine Reviews', dbgstrg2); AddCustomFieldValueByName('Magazine Reviews', 'Magazine Reviews :'+#13+dbgstrg2); end else LogMessage('magazine reviews not found'); // Honors and Awards dbgstrg1 := ''; curPos := Pos('

Honors and Awards

', HTML); if curPos>0 then begin //curPos := PosFrom('">', HTML,CurPos); curPos := PosFrom('
  • ', HTML, EndPos); if curPos > 0 then begin curPos := curPos + Length('
    • '); EndPos := PosFrom('
', HTML, curPos); dbgstrg3 := Trim(Copy(HTML, curPos, endPos - curPos)); dbgstrg3 := Trim(Copy(HTML,curPos,(EndPos-curPos))); dbgstrg3 := StringReplace(dbgstrg3, '
  • ', #13#160#160#9679#160#160, true, false, true); //dbgstrg3 := StringReplace(dbgstrg3, '