English > Support
Custom actors and directors field
afrocuban:
Hello Ivek.
I'm creating a new skin, pretty much different than anything seen here so far. As a teaser, It'll contain all the custom fields I'm aware of, around 160 as I already mentioned earlier.
For it to work properly, I need 2 custom fields: for IMDb actors without role and directors, with values separated with: " • ", or with double/triple space, even better.
I can't use existing human fields for those two, because they're by design of a link memo type, and with link memo it is impossible (at least for me) to achieve even simple goals in skin engineering.
I am more than willing to learn to do it myself with your help, of course. I can recognize patterns, and I already changed separator for Tv2 custom field with aforementioned, instead comma.
Thank you in advance
Ivek23:
You could edit the Tv2 (Long Text) custom field, because it is not a memo field, the data transfer is already done for the Long Text custom field in the IMDb script. As for the IMDb actors without role and directors, the data transfer would already be done in the IMDb script so that you could then still use the custom memo field or some other custom field, such as Long Text or Multiselect list. But first, you would need to edit the IMDb script for the IMDb actors without role and directors and then of course make these changes in the database as well
afrocuban:
Thanks for a feedback, Ivek.
I understood your points, and this is what I did
--- Code: ---
//Get to "Cast" ~actors~ ctActors
//Go Cast list
curPos:=Pos('<h3 class="ipc-title__text">Top cast',HTML); //Strings start which opens the block content data. WEB_SPECIFIC
curPos:=curPos+Length('<div class="ipc-avatar ipc-avatar--base ipc-avatar--dynamic-width" role="group">'); //Strings end which opens the block content data. WEB_SPECIFIC
//Get all "raw" crew summary (in raw because we need the hidden person links) May one person or severals in the ~crew~
endPos:=PosFrom('</li></ul><><><><>',HTML,curPos); //Strings which opens/closes the data. WEB_SPECIFIC
ItemList:=Copy(HTML,curPos,endPos-curPos);
//LogMessage(' Parse results ('+IntToStr(curPos)+','+IntToStr(endPos)+') complex ItemList:'+ItemList+'||');
curPos:=Pos('" class="ipc-image" loading="',ItemList) //String which opens the subList data. WEB_SPECIFIC
index:=1;
ItemValue1:=''; // Initialize the custom IMDb Cast field
While curPos>0 Do Begin
If (index>PEOPLE_LIMITS) Then break; //Limited depassed.
//Get PersonURL (Always must it has)
ItemValue:=TextBetWeen(ItemList,'<a data-testid="title-cast-item__actor" href="/name/','?ref_=tt_cl_t_',false,curPos);
PersonURL:=BASE_URL_PERSON_PRE + ItemValue + BASE_URL_SUF; //Strings which opens/closes the data. WEB_SPECIFIC
LogMessage(' Parse Results PersonURL:'+PersonURL+'||');
//Get Name (Always must it has)
//Name:=TextBetWeen(ItemList,'?ref_=tt_cl_t_'+IntToStr(index)+'" class="StyledComponents__ActorName-y9ygcu-1 eyqFnv"','</a><div class="title-cast-item__characters-list">',false,curPos);
Name:=TextBetWeen(ItemList,'">','</a><div class="title-cast-item__characters-list">',false,curPos); //Strings which opens/closes the data. WEB_SPECIFIC
//Name:=Trim(StringReplace(Name,'>','',True,False,True));
LogMessage(' Parse Results Name:'+Name+'||');
//Get Role YES: PVD save Role in cast (actors) people (Not always has link)
Role:=TextBetWeen(ItemList,' title-cast-item__char" data-testid="cast-item-characters-link">','</span><span data-testid="cast-item-characters-with-as" class="',false,curPos); //Strings which opens/closes the data. WEB_SPECIFIC
//Role:=Trim(StringReplace(Role,'>','',True,False,True));
///Role:=StringReplace(Role,Chr(13),'',True,False,True);
///Role:=StringReplace(Role,' ','',True,False,True);
LogMessage(' Parse Results Role:'+Role+'||');
If Pos('http://www.imdb.com/name//' ,PersonURL) < 1 then
AddMoviePerson(Name,'',Role,PersonURL,ctActors);
LogMessage(' Get results cast:#'+IntToStr(index)+'|'+Name+'|'+Role+'|'+PersonURL+'||ctActors');
// Custom field: IMDb Cast (names only, separated by " • ")
If ItemValue1='' Then
ItemValue1:=Name
Else
ItemValue1:=ItemValue1+' • '+Name;
//curPos:=PosFrom('" class="ipc-image" loading="',ItemList,curPos); //String which opens the Web Result item List data. WEB_SPECIFIC
index:=index+1;
End;
//LogMessage(#13+'');
End;
//*)
//(*
LogMessage(#13+'');
//*)
// Add custom field IMDb Cast
AddCustomFieldValueByName('IMDb Cast', ItemValue1);
// Log the IMDb Cast field for verification
LogMessage('IMDb Cast: '+ItemValue1);
//Get "plot_summary" as ~comment~ //debug_pos1-1
--- End code ---
Mysteriously and hilariously, instead of importing Cast, it imports Tv2 value into IMDb Cast field! It's some problem with ItemValue1 value that I'm trying to define, but I am not able to grasp what I'm doing wrong, so it pulls ItemValue1 from the first previous segment where it's used, and that is exactly Tv2 field in the script.
If you're willing to review and suggest snippet change, it would be appreciated as always.
P.S. Forum won't accept in the code section / div, but it's there in
<><><><>
so it's actually < / div >< / div >< / div >< / div >, without space inside, of course.
Ivek23:
Of course it doesn't transfer the correct information because this feature is not disabled. You probably have a setting to transfer information to "Cast" ~actors~ ctActors from the Full Cast&Crew website. Find this feature in the Script Options section at the top of the script and change the settings as shown below.
--- Code: --- //GET_FULL_CREDIT = True ; //Download Cast or Credit provider page for retreive the info. Otherwise only the info of the principal movie page.
GET_FULL_CREDIT = False ; //Download Cast or Credit provider page for retreive the info. Otherwise only the info of the principal movie page.
--- End code ---
I will edit a special script for this, maybe today for you.
Ivek23:
--- Quote from: Ivek23 on November 13, 2024, 11:33:58 am ---Of course it doesn't transfer the correct information because this feature is not disabled. You probably have a setting to transfer information to "Cast" ~actors~ ctActors from the Full Cast&Crew website. Find this feature in the Script Options section at the top of the script and change the settings as shown below.
--- Code: --- //GET_FULL_CREDIT = True ; //Download Cast or Credit provider page for retreive the info. Otherwise only the info of the principal movie page.
GET_FULL_CREDIT = False ; //Download Cast or Credit provider page for retreive the info. Otherwise only the info of the principal movie page.
--- End code ---
I will edit a special script for this, maybe today for you.
--- End quote ---
Here is a special IMDB_[EN][HTTPS]_TEST_2c(Cast&Crew)_(afrocuban) script for you, which is set up to transfer information to "Cast" ~actors~ ctActors from the Full Cast&Crew website. You can also edit other person information using it.
The IMDB_[EN][HTTPS]_TEST_2c script cannot transfer all person information from the primary IMDb movie pages, because it will need to make some corrections or updates to properly transfer all information again, because some changes were made to the source code of the IMDb pages again.
IMDB_[EN][HTTPS]_TEST_2c(Cast&Crew)_(afrocuban) script is attached.
Navigation
[0] Message Index
[#] Next page
Go to full version