Re: [Imdbpy-help] Can't retrieve original title

2019-06-30 Thread Davide Alberani
Hi Kamiku,
there are a couple of things to notice:

1.
the bug with the parser of the AKAs from the reference page (the one
we parse by default) is fixed in the repository version; please use
that one from Github.

2.
as you have noticed, when information about a movie is fetched, only
the "main" reference page is parsed (e.g.
https://www.imdb.com/title/tt0133093/reference ) and that one only
contains a small number of AKAs.

You can also parse the "release info" page (e.g.
https://www.imdb.com/title/tt0133093/releaseinfo ) which contains the
complete list. To do so:

>>> from imdb import IMDb
>>> i = IMDb()
>>> m = i.get_movie("0097694")
>>> akas = m.get('akas', [])
>>> i.update(m, 'release info')
>>> complete_akas = m.get('akas from release info', [])


Hope this helps,

On Sun, Jun 23, 2019 at 7:27 AM Kamiku  wrote:
>
> Hi Davide,
>
> thank you very much for your answer.
> It seems the movie.get('akas', []) method doesn't return the whole list 
> (anymore?).
>
> For instance, if I'm trying to retrieve the AKAs from the Japanese movie 
> "Kuroi ame": https://www.imdb.com/title/tt0097694/releaseinfo#akas
> Please note that when visiting the page you can find 19 items, "original 
> title" included.
> But the method below returned only 6 of them, one of which is not even a 
> title, it is "See more »".
>
> >>> from imdb import IMDb
> >>> i = IMDb()
> >>> m = i.get_movie("0097694")
> >>> akas = m.get('akas', [])
>
> Here the list returned contains only 1 element, that isn't correctly split:
> ['Black Rain\n(World-wide, English title)\n   
>  \n\n
> Black Rain\n(United Kingdom)\n
> \n\nPluie noire\n 
>(France)\n\n   
>  \nLluvia negra\n
> (Spain)\n\n\n 
>Pioggia nera\n(Italy)\n
> \n\nSee more »']
>
> And even if I split it after that, I still haven't got the whole list of akas:
> >>> a = akas[0].split("\n\n\n 
> >>>")
> >>> len(a)
> 6
>
> Is there any way to retrieve the complete list of akas, including the IMDb 
> "(original title)" item?
> Or to fix the method that's already there?
>
> Kind regards,
>
>
> Le jeu. 20 juin 2019 à 21:39, Davide Alberani  a 
> écrit :
>>
>> Hi Kamiku,
>> searching for a movie, if it's available, the original title will be
>> in the 'akas' key (a list of strings, if present).
>>
>> As an example, see the output for ID 0270841 from the following script:
>>
>> from imdb import IMDb
>> ia = IMDb()
>> for movie in ia.search_movie('matrix'):
>> print('id: %s; title: %s; akas: %s' % (movie.movieID,
>> movie.get('title'), ', '.join(movie.get('akas', []
>>
>> OUTPUT:
>> id: 0133093; title: The Matrix; akas:
>> id: 0106062; title: Matrix; akas:
>> id: 5274778; title: Matrix; akas:
>> id: 0234215; title: The Matrix Reloaded; akas:
>> id: 0242653; title: The Matrix Revolutions; akas:
>> id: 0295432; title: The Matrix Revisited; akas:
>> id: 0270841; title: Cyber Wars; akas: Matrix Hunters: Kynigoi ston 
>> kyvernohoro
>> id: 1842414; title: Matrix IV; akas:
>> id: 9642498; title: The Matrix; akas:
>> id: 0328832; title: The Animatrix; akas:
>> id: 0277828; title: Enter the Matrix; akas:
>> id: 6301452; title: Matriarch; akas:
>> id: 0390244; title: The Matrix Online; akas:
>> id: 0364888; title: Threat Matrix; akas:
>> id: 0451118; title: The Matrix: Path of Neo; akas:
>> id: 9851526; title: The Matrix; akas:
>> id: 0211096; title: V-World Matrix; akas:
>> id: 1499960; title: The Living Matrix; akas:
>> id: 0274085; title: Sex and the Matrix; akas:
>> id: 8793748; title: Matrixx; akas:
>>
>>
>> Notice that there's no guarantee that the 'akas' key is present, and
>> no way to tell if it contains the original title or another very
>> popular title for the same movie.
>>
>>
>> Hope this helps,
>>
>>
>> On Tue, Jun 18, 2019 at 10:35 AM Kamiku  wrote:
>> >
>> > Hello,
>> >
>> > is there any way to retrieve the original title instead of the English 
>> > title when searching a movie with the http methods?
>> >
>> > The Changelog says "searching for a movie, the original titles are 
>> > returned, instead of AKAs" about the sql version, but I can't find 
>> > anything about that same feature for http.
>> >
>> > I'm trying to retrieve original titles from non-English titled movies, but 
>> > so far no luck.
>> >
>> > Kind regards,
>> >
>> > Kamiku
>> > ___
>> > Imdbpy-help mailing list
>> > Imdbpy-help@lists.sourceforge.net
>> > 

Re: [Imdbpy-help] Can't retrieve original title

2019-06-22 Thread Kamiku
Hi Davide,

thank you very much for your answer.
It seems the *movie.get('akas', [])* method doesn't return the whole list
(anymore?).

For instance, if I'm trying to retrieve the AKAs from the Japanese movie
"Kuroi ame": https://www.imdb.com/title/tt0097694/releaseinfo#akas
Please note that when visiting the page you can find 19 items, "original
title" included.
But the method below returned only 6 of them, one of which is not even a
title, it is "*See more »*".


*>>> from imdb import IMDb*

*>>> i = IMDb()*

*>>> m = i.get_movie("0097694")*

*>>> akas = m.get('akas', [])*

Here the list returned contains only 1 element, that isn't correctly split:
['Black Rain\n(World-wide, English title)\n
   \n\n
 Black Rain\n(United Kingdom)\n
   \n\nPluie
noire\n(France)\n\n
   \nLluvia negra\n
   (Spain)\n\n
 \nPioggia nera\n
 (Italy)\n\n\n
   See more »']

And even if I split it after that, I still haven't got the whole list of
akas:

*>>> a = akas[0].split("\n\n
 \n")*


*>>> len(a)6*

Is there any way to retrieve the complete list of akas, including the IMDb
"(original title)" item?
Or to fix the method that's already there?

Kind regards,


Le jeu. 20 juin 2019 à 21:39, Davide Alberani  a
écrit :

> Hi Kamiku,
> searching for a movie, if it's available, the original title will be
> in the 'akas' key (a list of strings, if present).
>
> As an example, see the output for ID 0270841 from the following script:
>
> from imdb import IMDb
> ia = IMDb()
> for movie in ia.search_movie('matrix'):
> print('id: %s; title: %s; akas: %s' % (movie.movieID,
> movie.get('title'), ', '.join(movie.get('akas', []
>
> OUTPUT:
> id: 0133093; title: The Matrix; akas:
> id: 0106062; title: Matrix; akas:
> id: 5274778; title: Matrix; akas:
> id: 0234215; title: The Matrix Reloaded; akas:
> id: 0242653; title: The Matrix Revolutions; akas:
> id: 0295432; title: The Matrix Revisited; akas:
> id: 0270841; title: Cyber Wars; akas: Matrix Hunters: Kynigoi ston
> kyvernohoro
> id: 1842414; title: Matrix IV; akas:
> id: 9642498; title: The Matrix; akas:
> id: 0328832; title: The Animatrix; akas:
> id: 0277828; title: Enter the Matrix; akas:
> id: 6301452; title: Matriarch; akas:
> id: 0390244; title: The Matrix Online; akas:
> id: 0364888; title: Threat Matrix; akas:
> id: 0451118; title: The Matrix: Path of Neo; akas:
> id: 9851526; title: The Matrix; akas:
> id: 0211096; title: V-World Matrix; akas:
> id: 1499960; title: The Living Matrix; akas:
> id: 0274085; title: Sex and the Matrix; akas:
> id: 8793748; title: Matrixx; akas:
>
>
> Notice that there's no guarantee that the 'akas' key is present, and
> no way to tell if it contains the original title or another very
> popular title for the same movie.
>
>
> Hope this helps,
>
>
> On Tue, Jun 18, 2019 at 10:35 AM Kamiku  wrote:
> >
> > Hello,
> >
> > is there any way to retrieve the original title instead of the English
> title when searching a movie with the http methods?
> >
> > The Changelog says "searching for a movie, the original titles are
> returned, instead of AKAs" about the sql version, but I can't find anything
> about that same feature for http.
> >
> > I'm trying to retrieve original titles from non-English titled movies,
> but so far no luck.
> >
> > Kind regards,
> >
> > Kamiku
> > ___
> > Imdbpy-help mailing list
> > Imdbpy-help@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/imdbpy-help
>
>
>
> --
> Davide Alberani   [PGP KeyID:
> 0x3845A3D4AC9B61AD]
> http://www.mimante.net/
>
___
Imdbpy-help mailing list
Imdbpy-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/imdbpy-help


Re: [Imdbpy-help] Can't retrieve original title

2019-06-20 Thread Davide Alberani
Hi Kamiku,
searching for a movie, if it's available, the original title will be
in the 'akas' key (a list of strings, if present).

As an example, see the output for ID 0270841 from the following script:

from imdb import IMDb
ia = IMDb()
for movie in ia.search_movie('matrix'):
print('id: %s; title: %s; akas: %s' % (movie.movieID,
movie.get('title'), ', '.join(movie.get('akas', []

OUTPUT:
id: 0133093; title: The Matrix; akas:
id: 0106062; title: Matrix; akas:
id: 5274778; title: Matrix; akas:
id: 0234215; title: The Matrix Reloaded; akas:
id: 0242653; title: The Matrix Revolutions; akas:
id: 0295432; title: The Matrix Revisited; akas:
id: 0270841; title: Cyber Wars; akas: Matrix Hunters: Kynigoi ston kyvernohoro
id: 1842414; title: Matrix IV; akas:
id: 9642498; title: The Matrix; akas:
id: 0328832; title: The Animatrix; akas:
id: 0277828; title: Enter the Matrix; akas:
id: 6301452; title: Matriarch; akas:
id: 0390244; title: The Matrix Online; akas:
id: 0364888; title: Threat Matrix; akas:
id: 0451118; title: The Matrix: Path of Neo; akas:
id: 9851526; title: The Matrix; akas:
id: 0211096; title: V-World Matrix; akas:
id: 1499960; title: The Living Matrix; akas:
id: 0274085; title: Sex and the Matrix; akas:
id: 8793748; title: Matrixx; akas:


Notice that there's no guarantee that the 'akas' key is present, and
no way to tell if it contains the original title or another very
popular title for the same movie.


Hope this helps,


On Tue, Jun 18, 2019 at 10:35 AM Kamiku  wrote:
>
> Hello,
>
> is there any way to retrieve the original title instead of the English title 
> when searching a movie with the http methods?
>
> The Changelog says "searching for a movie, the original titles are returned, 
> instead of AKAs" about the sql version, but I can't find anything about that 
> same feature for http.
>
> I'm trying to retrieve original titles from non-English titled movies, but so 
> far no luck.
>
> Kind regards,
>
> Kamiku
> ___
> Imdbpy-help mailing list
> Imdbpy-help@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/imdbpy-help



-- 
Davide Alberani   [PGP KeyID: 0x3845A3D4AC9B61AD]
http://www.mimante.net/


___
Imdbpy-help mailing list
Imdbpy-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/imdbpy-help