English > Scripts and Templates

Script: TheMovieDB [ES] (Easy API Script)

<< < (8/11) > >>

Ivek23:

--- Quote from: VVV_Easy_Programing on December 21, 2014, 09:49:14 am ---(If some movie fails, please send me the title, the bad information and the search language. Thank you.)
--- End quote ---

Yes, I found bugs in Search Results:


--- Code: ---LANG_STR      = '?language=es';
--- End code ---

in this movie World Trade Center find a cosmetic bug in Search Results:

Problematic is the following piece of code,
--- Code: ---            curPos:=PosFrom('"poster_path":"',HTML,endPos)+Length('"poster_path":"');               //WEB_SPECIFIC
            endPos:=PosFrom('"',HTML,curPos);                                                       //WEB_SPECIFIC
            PreviewURL:='http://image.tmdb.org/t/p/w92'+Copy(HTML,curPos,endPos-curPos);            //WEB_SPECIFIC. w92,w185,w300,w342,original.
            LogMessage('      Parse Results PreviewURL:'+PreviewURL+'||');
--- End code ---
when displaying search results, only three addresses are correct, the fourth, which link does not work, and the fifth title of the copies of the first and second title in search results.

After correcting this part of the code
--- Code: ---function ParsePage(HTML:String;URL:AnsiString):Cardinal;
    var
      curPos,endPos,NumbResult:Integer;
      Title,OriTitle,Year,MovieURL,PreviewURL1,PreviewURL,ItemValue,ItemList,Name,Role,PersonURL:String;     
    begin
.
.
.
            LogMessage('      Parse Results Year:'+Year+'||');
            curPos:=PosFrom('"poster_path":',HTML,endPos)+Length('"poster_path":');               //WEB_SPECIFIC
            endPos:=PosFrom('"popularity"',HTML,curPos);                                                       //WEB_SPECIFIC
            PreviewURL1:='http://image.tmdb.org/t/p/w92'+Copy(HTML,curPos,endPos-curPos);            //WEB_SPECIFIC. w45,w92,w185,w300,w342,original.
            PreviewURL1 := StringReplace(PreviewURL1, '"', '', True, True, False);
PreviewURL1 := StringReplace(PreviewURL1, 'null', '', True, True, False);
            PreviewURL:=PreviewURL1;            //WEB_SPECIFIC. w45,w92,w185,w300,w342,original.
            LogMessage('      Parse Results PreviewURL:'+PreviewURL+'||');           
.
.
.
--- End code ---
but now the search results with the correct movie titles.

In this movie Blade find a cosmetic bug in Search Results:

Search results the appear with larger the number of movie titles,then occurs several times the same set of movie titles, actually a four times.


--- Code: ---//Not Implemented get information of "popularity" "vote_count" "keywords" "images"
--- End code ---

"keywords" also means "tags" and the normal Tags field in PVD
--- Code: ---AddFieldValueXML('tags',ItemValue);
--- End code ---

"vote_count"  it can be custom TheMoviedb Votes field in PVD.

It may help this one piece of code:
--- Code: ---//~Votes~
 curPos := PosFrom('"vote_count":', HTML, EndPos);
 if curPos > 0 then begin
  curPos := PosFrom('"vote_count":', HTML, EndPos);
endPos := PosFrom(',"alternative_titles"', HTML, curPos);
    TmpStr1 :=  TextBetween(HTML, '"vote_count":', ',"alternative_titles"', True, curPos);
 if TmpStr1 = '0' then
TmpStr1 := '';
   AddCustomFieldValueByName('TheMoviedb Votes', TmpStr1);
 if TmpStr1 = '' then
TmpStr1 := 'vote unknown';
 end;
--- End code ---

VVV_Easy_Programing:
CHANGE LOG (27/12/2014):
            V 0.2.0.3   VVV: Fixed bug with movie list search URL when the poster is 'null' (Ivek23 detected)
                                    Add the "keywords" as "tags" (Ivek23 proposition)
                                    Add (needs Custom Field ~TheMoviedb_Votes~) "vote_count" (Ivek23 proposition)
Attached the new versión.

(Thanks Ivek23)

(Edito: New version down)

Ivek23:
The script does not work anymore (search results).

VVV_Easy_Programing:
CHANGE LOG (08/01/2016):
            V 0.2.0.5   VVV: Fixed bug with the "total_results" detection (before it was the last information now "total_pages" is the last).
                             Adjust to the new order of received informations for "Parsing search Movies"
                             Eliminate "2014" from name.

Attached the new versión.

(Thanks again Ivek23)

(Edito: New version down)

Ivek23:

--- Quote from: VVV_Easy_Programing on January 08, 2016, 03:07:57 pm ---(Thanks again Ivek23)
--- End quote ---

Thank you for the new version.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version