[Approved] [French] allocine.fr (2009-01-31) (2 Viewers)

castagn

Portal Member
January 1, 2011
14
0
Merci pour l'info de la config, je regarderais. Pour le site aucun soucis par la voie normale ;)
 

bborde

Portal Member
November 7, 2008
5
0
Bonjour à tous,
Je suis ce post depuis un moment et vous m'avez déjà sauvé la vie. Mais subitement ce soir, le script ne fonctionne plus. J'ai d'abord cru que la mise à jour 1.1.3 était responsable, mais j'avais une image de mon système en version précédente mais rien.
Je pense donc que cela vient d'un changement chez Allocine.
Suis-je le seul à avoir le pb.. et si un champion du script peut m'aider ce serait super cool.

Merci d'avance.
 

nazgul64

New Member
May 21, 2009
4
0
Home Country
France France
Bonjour,

Effectivement j'ai aussi des problèmes pour trouver les films dans la base de données Allociné.
J'ai donc regardé le comportement de la fonction FindFilm sur quelques exemples.

Tout semble se jouer (sauf erreur) au niveau de la ligne d'extraction via expression régulière :
MatchCollection myMatches = Regex.Matches(strBody, "<a href='/film/fichefilm_gen_cfilm=(?<IDfilm>[0-9]{4,6}).html'>(?<nom>[^</a>].*?)</a>(?<name>[^<br].*?)<br />.*?(?<annee>[0-9]{4}).*?<div>");

Problèmes constatés :
_ l'occurence du titre original (champ <name>) peut perturber l'acquisition des données relatives au film.
_ la présence des balises <b> dans le champ <nom> peut aussi être problématique surtout lorsqu'elles sont collées au caractère ">" (exemple : ".html'><b>Les</b> <b>Douze</b> <b>Travaux</b> <b>d'Asterix</b>")

Solutions temporaires : (pas satisfaisantes car peu élégantes et surtout dégradation des fonctions initiales)
_ enlèvement du titre original de la lecture.
_ remplacement des occurences "><b" par "> <b" avant le traitement par expression régulière.

=>
----------------------------------------------------------- Code remplacé -----------------------------------------------------------

strBody= strBody.Replace("\n", "").Replace("\r", "") ;
MatchCollection myMatches = Regex.Matches(strBody, "<a href='/film/fichefilm_gen_cfilm=(?<IDfilm>[0-9]{4,6}).html'>(?<nom>[^</a>].*?)</a>(?<name>[^<br].*?)<br />.*?(?<annee>[0-9]{4}).*?<div>");

----------------------------------------------------------- Code de remplacement -----------------------------------------------------------
strBody= strBody.Replace("\n", "").Replace("\r", "") ;
strBody = strBody.Replace("><b", "> <b");
MatchCollection myMatches = Regex.Matches(strBody, "<a href='/film/fichefilm_gen_cfilm=(?<IDfilm>[0-9]{4,6}).html'>(?<nom>[^</a>].*?)</a>.*?(?<annee>[0-9]{4}).*?<div>");



Finallement, sur les quelques exemples que j'ai testés, FindFilm refonctionne.
Par contre, j'ai constaté un autre problème (fonction GetDetails), certaines données (comme le "genre") ne sont plus importées.

En espérant que cela fasse avancer les choses :D
 

Attachments

  • allocine_fr_25042011.zip
    4 KB

fmarcia

Portal Member
April 20, 2008
76
6
Boussy Saint Antoine
Home Country
France France
Re : [French] allocine.fr (2009-01-31)

Voici la version que j'utilise. Il reste quelques problèmes quand le résultat de la recherche contient des films sans année mais j'arrive à m'en accommoder. Il récupère titre, titre original, durée, année, affiche, genre, réalisateur, note, synopsis, MPA rating et casting.
 

Attachments

  • allocine_fr.csscript.zip
    3.7 KB

Bulgroz

Portal Member
June 10, 2011
6
4
Home Country
France France
Hello !
I've edited your script with the following qwery to allocine.fr :

string strURL = "http://www.allocine.fr/recherche/1/?q=" + HttpUtility.UrlDecode(strSearch, Encoding.UTF8);

This permit to have all the responses from the website and not only the 5 first.

I think also you must change the actors string by

movieDetails.Cast += Acteurs.Groups["nom"].Value;

(Old value is movieDetails.Cast += Acteurs.Groups["nom"].Value + " est " + Acteurs.Groups["role"].Value.Trim();)

This optimize the search by actors in mediaportal interface.

(Sorry for my english...)
 

MEGA180

Portal Pro
January 8, 2007
102
5
61
Home Country
France France
Thank you, It's better now for artists, I tried your modif. :D
Do you think it will be possible to also add IMDB id (to search for cover when missing) ?

I'm still not understanding how the fanart grabbing works and I'm still missing a lot of fanarts.

Some others are not in the video database editor but shows in mediaPortal (may be because I activated the fanart plugin). But some are wrong and I don't know where to change them. Can somebody help me with that ?

Otherwise the grabber works fine.
 

Users who are viewing this thread

Top Bottom