pax_global_header 0000666 0000000 0000000 00000000064 13034501123 0014502 g ustar 00root root 0000000 0000000 52 comment=ec6516cf330dc1385c2faec2912c318c69b6da67
woob-ec6516cf330dc1385c2faec2912c318c69b6da67-modules-imdb/ 0000775 0000000 0000000 00000000000 13034501123 0022106 5 ustar 00root root 0000000 0000000 woob-ec6516cf330dc1385c2faec2912c318c69b6da67-modules-imdb/modules/ 0000775 0000000 0000000 00000000000 13034501123 0023556 5 ustar 00root root 0000000 0000000 woob-ec6516cf330dc1385c2faec2912c318c69b6da67-modules-imdb/modules/imdb/ 0000775 0000000 0000000 00000000000 13034501123 0024471 5 ustar 00root root 0000000 0000000 woob-ec6516cf330dc1385c2faec2912c318c69b6da67-modules-imdb/modules/imdb/__init__.py 0000664 0000000 0000000 00000001425 13034501123 0026604 0 ustar 00root root 0000000 0000000 # -*- coding: utf-8 -*-
# Copyright(C) 2013 Julien Veyssier
#
# This file is part of weboob.
#
# weboob is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# weboob is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with weboob. If not, see .
from .module import ImdbModule
__all__ = ['ImdbModule']
woob-ec6516cf330dc1385c2faec2912c318c69b6da67-modules-imdb/modules/imdb/browser.py 0000664 0000000 0000000 00000020443 13034501123 0026531 0 ustar 00root root 0000000 0000000 # -*- coding: utf-8 -*-
# Copyright(C) 2013 Julien Veyssier
#
# This file is part of weboob.
#
# weboob is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# weboob is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with weboob. If not, see .
import re
from HTMLParser import HTMLParser
from weboob.deprecated.browser import Browser, BrowserHTTPNotFound
from weboob.capabilities.base import NotAvailable, NotLoaded
from weboob.capabilities.cinema import Movie, Person
from weboob.tools.json import json
from .pages import PersonPage, MovieCrewPage, BiographyPage, ReleasePage
from datetime import datetime
__all__ = ['ImdbBrowser']
class ImdbBrowser(Browser):
DOMAIN = 'www.imdb.com'
PROTOCOL = 'http'
ENCODING = 'utf-8'
USER_AGENT = Browser.USER_AGENTS['wget']
PAGES = {
'http://www.imdb.com/title/tt[0-9]*/fullcredits.*': MovieCrewPage,
'http://www.imdb.com/title/tt[0-9]*/releaseinfo.*': ReleasePage,
'http://www.imdb.com/name/nm[0-9]*/*': PersonPage,
'http://www.imdb.com/name/nm[0-9]*/bio.*': BiographyPage,
}
def iter_movies(self, pattern):
res = self.readurl('http://www.imdb.com/xml/find?json=1&nr=1&tt=on&q=%s' % pattern.encode('utf-8'))
jres = json.loads(res)
htmlparser = HTMLParser()
for cat in ['title_popular', 'title_exact', 'title_approx']:
if cat in jres:
for m in jres[cat]:
tdesc = unicode(m['title_description'])
if '' in tdesc:
short_description = u'%s %s' % (tdesc.split('<')[
0].strip(', '), tdesc.split('>')[1].split('<')[0])
else:
short_description = tdesc.strip(', ')
movie = Movie(m['id'], htmlparser.unescape(m['title']))
movie.other_titles = NotLoaded
movie.release_date = NotLoaded
movie.duration = NotLoaded
movie.short_description = htmlparser.unescape(short_description)
movie.pitch = NotLoaded
movie.country = NotLoaded
movie.note = NotLoaded
movie.roles = NotLoaded
movie.all_release_dates = NotLoaded
movie.thumbnail_url = NotLoaded
yield movie
def iter_persons(self, pattern):
res = self.readurl('http://www.imdb.com/xml/find?json=1&nr=1&nm=on&q=%s' % pattern.encode('utf-8'))
jres = json.loads(res)
htmlparser = HTMLParser()
for cat in ['name_popular', 'name_exact', 'name_approx']:
if cat in jres:
for p in jres[cat]:
person = Person(p['id'], htmlparser.unescape(unicode(p['name'])))
person.real_name = NotLoaded
person.birth_place = NotLoaded
person.birth_date = NotLoaded
person.death_date = NotLoaded
person.gender = NotLoaded
person.nationality = NotLoaded
person.short_biography = NotLoaded
person.short_description = htmlparser.unescape(p['description'])
person.roles = NotLoaded
person.thumbnail_url = NotLoaded
yield person
def get_movie(self, id):
res = self.readurl('http://www.omdbapi.com/?i=%s&plot=full' % id)
if res is not None:
jres = json.loads(res)
else:
return None
htmlparser = HTMLParser()
title = NotAvailable
duration = NotAvailable
release_date = NotAvailable
pitch = NotAvailable
country = NotAvailable
note = NotAvailable
short_description = NotAvailable
thumbnail_url = NotAvailable
other_titles = []
genres = []
roles = {}
if 'Title' not in jres:
return
title = htmlparser.unescape(unicode(jres['Title'].strip()))
if 'Poster' in jres:
thumbnail_url = unicode(jres['Poster'])
if 'Director' in jres:
short_description = unicode(jres['Director'])
if 'Genre' in jres:
for g in jres['Genre'].split(', '):
genres.append(g)
if 'Runtime' in jres:
m = re.search('(\d+?) min', jres['Runtime'])
if m:
duration = int(m.group(1))
if 'Released' in jres:
released_string = str(jres['Released'])
if released_string == 'N/A':
release_date = NotAvailable
else:
months = {
'Jan':'01',
'Feb':'02',
'Mar':'03',
'Apr':'04',
'May':'05',
'Jun':'06',
'Jul':'07',
'Aug':'08',
'Sep':'09',
'Oct':'10',
'Nov':'11',
'Dec':'12',
}
for st in months:
released_string = released_string.replace(st,months[st])
release_date = datetime.strptime(released_string, '%d %m %Y')
if 'Country' in jres:
country = u''
for c in jres['Country'].split(', '):
country += '%s, ' % c
country = country[:-2]
if 'Plot' in jres:
pitch = unicode(jres['Plot'])
if 'imdbRating' in jres and 'imdbVotes' in jres:
note = u'%s/10 (%s votes)' % (jres['imdbRating'], jres['imdbVotes'])
for r in ['Actors', 'Director', 'Writer']:
if '%s' % r in jres.keys():
roles['%s' % r] = [('N/A',e) for e in jres['%s' % r].split(', ')]
movie = Movie(id, title)
movie.other_titles = other_titles
movie.release_date = release_date
movie.duration = duration
movie.genres = genres
movie.pitch = pitch
movie.country = country
movie.note = note
movie.roles = roles
movie.short_description = short_description
movie.all_release_dates = NotLoaded
movie.thumbnail_url = thumbnail_url
return movie
def get_person(self, id):
try:
self.location('http://www.imdb.com/name/%s' % id)
except BrowserHTTPNotFound:
return
assert self.is_on_page(PersonPage)
return self.page.get_person(id)
def get_person_biography(self, id):
self.location('http://www.imdb.com/name/%s/bio' % id)
assert self.is_on_page(BiographyPage)
return self.page.get_biography()
def iter_movie_persons(self, movie_id, role):
self.location('http://www.imdb.com/title/%s/fullcredits' % movie_id)
assert self.is_on_page(MovieCrewPage)
for p in self.page.iter_persons(role):
yield p
def iter_person_movies(self, person_id, role):
self.location('http://www.imdb.com/name/%s' % person_id)
assert self.is_on_page(PersonPage)
return self.page.iter_movies(role)
def iter_person_movies_ids(self, person_id):
self.location('http://www.imdb.com/name/%s' % person_id)
assert self.is_on_page(PersonPage)
for movie in self.page.iter_movies_ids():
yield movie
def iter_movie_persons_ids(self, movie_id):
self.location('http://www.imdb.com/title/%s/fullcredits' % movie_id)
assert self.is_on_page(MovieCrewPage)
for person in self.page.iter_persons_ids():
yield person
def get_movie_releases(self, id, country):
self.location('http://www.imdb.com/title/%s/releaseinfo' % id)
assert self.is_on_page(ReleasePage)
return self.page.get_movie_releases(country)
woob-ec6516cf330dc1385c2faec2912c318c69b6da67-modules-imdb/modules/imdb/favicon.png 0000664 0000000 0000000 00000003765 13034501123 0026637 0 ustar 00root root 0000000 0000000 PNG
IHDR @ @ iq bKGD pHYs tIME
ӊ IDATxmlSIHHH M[UJ!iF5\B+Ok2I,
i:A`t!%UCH$`;`KW&ϧks}y}QC`@ P (
`]:l@60 R$ І>n ׁ+@=n9w7jmfӎ_ K w 'm;A0:`kRQC`ni 0"`7,v얃wd
kmv f9U;_^-{ ɚ(+]f4
0E!)v p! &k HCN"+[l fu7P<␏ &`hNz951t}WdО͎{8\DUa4ڈ|F-scY65{QPH130 .{:>#_aN?,^i
/KØw{p1T_x{ al>' %YWۏ'Ѩ¿Gf{
^^|FmM Y7>\ p.6ldWxy/0\@`*; pB| ϿЎ%*'7'.a琳mjWE\X Y^*Nd?&T:HύC"#M}8nl^~):Çwrոq:jQQ;LRhl~"j<nrf$oiWNua-Pw˕~ &NxtZ _}=a*5'*$j~g߁;,Zʵ#pT*ڻ_y"zRRrQUsYJ˚ȝ<Tnxͮ8v@u$7oq6(mopb#"Q璖ok"@ 3y+W6ˋ.w˖VU+yxXtjkTUٺ='l._8G % Q7f0.^pv0M̜Bjd5[6i*O@^VkL!k֫TU9uƅ:ҝFNʖ'\̝###yЃ"Ex_-r"9Y=2H/~UCex >r+i̘Gcs'Gz[?+3zP)mu꣏sϞǣ$)=:^(ޘ! u9:VL(@ԒŢ:;(ZSG`1h Yi+O:oHXҝpjF/M}* 7@Ws5n{SDW;FA^>;;}p9T䗛nܗ'; |KL?4Y?WT!1-"iqO@VsEJIgdxIr9 Tg_053^DډI{XK,G(Xm`G=d~KQ9ZS&ǴDo$P!ɩa5~ց)0=W 46{ )I -Uͬ<&Ƹl̞c]
cF>>̖nh#! ơlv^fl#|!R C="$cVf|C;oC]ˀ!" }>qP7;;o
@ P o+gb( IENDB` woob-ec6516cf330dc1385c2faec2912c318c69b6da67-modules-imdb/modules/imdb/module.py 0000664 0000000 0000000 00000010070 13034501123 0026326 0 ustar 00root root 0000000 0000000 # -*- coding: utf-8 -*-
# Copyright(C) 2013 Julien Veyssier
#
# This file is part of weboob.
#
# weboob is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# weboob is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with weboob. If not, see .
from weboob.capabilities.cinema import CapCinema, Person, Movie
from weboob.tools.backend import Module
from .browser import ImdbBrowser
from urllib import quote_plus
__all__ = ['ImdbModule']
class ImdbModule(Module, CapCinema):
NAME = 'imdb'
MAINTAINER = u'Julien Veyssier'
EMAIL = 'julien.veyssier@aiur.fr'
VERSION = '1.3'
DESCRIPTION = 'Internet Movie Database service'
LICENSE = 'AGPLv3+'
BROWSER = ImdbBrowser
def get_movie(self, id):
return self.browser.get_movie(id)
def get_person(self, id):
return self.browser.get_person(id)
def iter_movies(self, pattern):
return self.browser.iter_movies(quote_plus(pattern.encode('utf-8')))
def iter_persons(self, pattern):
return self.browser.iter_persons(quote_plus(pattern.encode('utf-8')))
def iter_movie_persons(self, id, role=None):
return self.browser.iter_movie_persons(id, role)
def iter_person_movies(self, id, role=None):
return self.browser.iter_person_movies(id, role)
def iter_person_movies_ids(self, id):
return self.browser.iter_person_movies_ids(id)
def iter_movie_persons_ids(self, id):
return self.browser.iter_movie_persons_ids(id)
def get_person_biography(self, id):
return self.browser.get_person_biography(id)
def get_movie_releases(self, id, country=None):
return self.browser.get_movie_releases(id, country)
def fill_person(self, person, fields):
if 'real_name' in fields or 'birth_place' in fields\
or 'death_date' in fields or 'nationality' in fields\
or 'short_biography' in fields or 'roles' in fields\
or 'birth_date' in fields or 'thumbnail_url' in fields\
or 'gender' in fields or fields is None:
per = self.get_person(person.id)
person.real_name = per.real_name
person.birth_date = per.birth_date
person.death_date = per.death_date
person.birth_place = per.birth_place
person.gender = per.gender
person.nationality = per.nationality
person.short_biography = per.short_biography
person.short_description = per.short_description
person.roles = per.roles
person.thumbnail_url = per.thumbnail_url
if 'biography' in fields:
person.biography = self.get_person_biography(person.id)
return person
def fill_movie(self, movie, fields):
if 'other_titles' in fields or 'release_date' in fields\
or 'duration' in fields or 'country' in fields\
or 'roles' in fields or 'note' in fields\
or 'thumbnail_url' in fields:
mov = self.get_movie(movie.id)
movie.other_titles = mov.other_titles
movie.release_date = mov.release_date
movie.duration = mov.duration
movie.pitch = mov.pitch
movie.country = mov.country
movie.note = mov.note
movie.roles = mov.roles
movie.genres = mov.genres
movie.short_description = mov.short_description
movie.thumbnail_url = mov.thumbnail_url
if 'all_release_dates' in fields:
movie.all_release_dates = self.get_movie_releases(movie.id)
return movie
OBJECTS = {
Person: fill_person,
Movie: fill_movie
}
woob-ec6516cf330dc1385c2faec2912c318c69b6da67-modules-imdb/modules/imdb/pages.py 0000664 0000000 0000000 00000022473 13034501123 0026152 0 ustar 00root root 0000000 0000000 # -*- coding: utf-8 -*-
# Copyright(C) 2013 Julien Veyssier
#
# This file is part of weboob.
#
# weboob is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# weboob is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with weboob. If not, see .
from weboob.capabilities.cinema import Person, Movie
from weboob.capabilities.base import NotAvailable, NotLoaded
from weboob.deprecated.browser import Page
from weboob.tools.html import html2text
from datetime import datetime
import re
class ReleasePage(Page):
''' Page containing releases of a movie
'''
def get_movie_releases(self, country_filter):
result = unicode()
links = self.parser.select(self.document.getroot(), 'table#release_dates a')
for a in links:
href = a.attrib.get('href', '')
# XXX: search() could raise an exception
if href.strip('/').split('/')[0] == 'calendar' and\
(country_filter is None or re.search('region=([a-zA-Z]+)&', href).group(1).lower() == country_filter):
country = a.text
td_date = self.parser.select(a.getparent().getparent().getparent(), 'td')[1]
date_links = self.parser.select(td_date, 'a')
if len(date_links) > 1:
date = date_links[1].attrib.get('href', '').strip('/').split('/')[-1]
date += '-'+date_links[0].attrib.get('href', '').strip('/').split('/')[-1]
else:
date = unicode(self.parser.select(a.getparent().getparent().getparent(), 'td')[1].text_content())
result += '%s : %s\n' % (country, date)
if result == u'':
result = NotAvailable
else:
result = result.strip()
return result
class BiographyPage(Page):
''' Page containing biography of a person
'''
def get_biography(self):
bio = unicode()
start = False
tn = self.parser.select(self.document.getroot(), 'div#bio_content', 1)
for el in tn.getchildren():
if el.attrib.get('name') == 'mini_bio':
start = True
if start:
bio += html2text(self.parser.tostring(el))
return bio
class MovieCrewPage(Page):
''' Page listing all the persons related to a movie
'''
def iter_persons(self, role_filter=None):
if (role_filter is None or (role_filter is not None and role_filter == 'actor')):
tables = self.parser.select(self.document.getroot(), 'table.cast_list')
if len(tables) > 0:
table = tables[0]
tds = self.parser.select(table, 'td.itemprop')
for td in tds:
id = td.find('a').attrib.get('href', '').strip('/').split('/')[1]
name = unicode(td.find('a').text)
char_name = unicode(self.parser.select(td.getparent(), 'td.character', 1).text_content())
person = Person(id, name)
person.short_description = char_name
person.real_name = NotLoaded
person.birth_place = NotLoaded
person.birth_date = NotLoaded
person.death_date = NotLoaded
person.gender = NotLoaded
person.nationality = NotLoaded
person.short_biography = NotLoaded
person.roles = NotLoaded
person.thumbnail_url = NotLoaded
yield person
for gloss_link in self.parser.select(self.document.getroot(), 'table[cellspacing="1"] h5 a'):
role = gloss_link.attrib.get('name', '').rstrip('s')
if (role_filter is None or (role_filter is not None and role == role_filter)):
tbody = gloss_link.getparent().getparent().getparent().getparent()
for line in self.parser.select(tbody, 'tr')[1:]:
for a in self.parser.select(line, 'a'):
role_detail = NotAvailable
href = a.attrib.get('href', '')
if '/name/nm' in href:
id = href.strip('/').split('/')[-1]
name = unicode(a.text)
if 'glossary' in href:
role_detail = unicode(a.text)
person = Person(id, name)
person.short_description = role_detail
yield person
# yield self.browser.get_person(id)
def iter_persons_ids(self):
tables = self.parser.select(self.document.getroot(), 'table.cast_list')
if len(tables) > 0:
table = tables[0]
tds = self.parser.select(table, 'td.itemprop')
for td in tds:
id = td.find('a').attrib.get('href', '').strip('/').split('/')[1]
yield id
class PersonPage(Page):
''' Page informing about a person
It is used to build a Person instance and to get the movie list related to a person
'''
def get_person(self, id):
name = NotAvailable
short_biography = NotAvailable
short_description = NotAvailable
birth_place = NotAvailable
birth_date = NotAvailable
death_date = NotAvailable
real_name = NotAvailable
gender = NotAvailable
thumbnail_url = NotAvailable
roles = {}
nationality = NotAvailable
td_overview = self.parser.select(self.document.getroot(), 'td#overview-top', 1)
descs = self.parser.select(td_overview, 'span[itemprop=description]')
if len(descs) > 0:
short_biography = unicode(descs[0].text)
rname_block = self.parser.select(td_overview, 'div.txt-block h4.inline')
if len(rname_block) > 0 and "born" in rname_block[0].text.lower():
links = self.parser.select(rname_block[0].getparent(), 'a')
for a in links:
href = a.attrib.get('href', '').strip()
if href == 'bio':
real_name = unicode(a.text.strip())
elif 'birth_place' in href:
birth_place = unicode(a.text.lower().strip())
names = self.parser.select(td_overview, 'h1 span[itemprop=name]')
if len(names) > 0:
name = unicode(names[0].text.strip())
times = self.parser.select(td_overview, 'time[itemprop=birthDate]')
if len(times) > 0:
time = times[0].attrib.get('datetime', '').split('-')
if len(time) == 3 and int(time[0]) >= 1900:
birth_date = datetime(int(time[0]), int(time[1]), int(time[2]))
dtimes = self.parser.select(td_overview, 'time[itemprop=deathDate]')
if len(dtimes) > 0:
dtime = dtimes[0].attrib.get('datetime', '').split('-')
if len(dtime) == 3 and int(dtime[0]) >= 1900:
death_date = datetime(int(dtime[0]), int(dtime[1]), int(dtime[2]))
img_thumbnail = self.parser.select(self.document.getroot(), 'td#img_primary img')
if len(img_thumbnail) > 0:
thumbnail_url = unicode(img_thumbnail[0].attrib.get('src', ''))
roles = self.get_roles()
person = Person(id, name)
person.real_name = real_name
person.birth_date = birth_date
person.death_date = death_date
person.birth_place = birth_place
person.gender = gender
person.nationality = nationality
person.short_biography = short_biography
person.short_description = short_description
person.roles = roles
person.thumbnail_url = thumbnail_url
return person
def iter_movies_ids(self):
for role_div in self.parser.select(self.document.getroot(), 'div#filmography div.filmo-category-section > div'):
for a in self.parser.select(role_div, 'a'):
m = re.search('/title/(tt.*)/\?.*', a.attrib.get('href'))
if m:
yield m.group(1)
def get_roles(self):
roles = {}
for role_div in self.parser.select(self.document.getroot(), 'div#filmography > div.head'):
role = self.parser.select(role_div, 'a')[-1].text
roles[role] = []
category = role_div.attrib.get('data-category')
for infos in self.parser.select(self.document.getroot(), 'div#filmography > div.filmo-category-section > div'):
if category in infos.attrib.get('id'):
roles[role].append(('N/A',infos.text_content().replace('\n', ' ').strip()))
return roles
def iter_movies(self, role_filter=None):
for role_div in self.parser.select(self.document.getroot(), 'div#filmography > div.filmo-category-section > div'):
for a in self.parser.select(role_div, 'a'):
m = re.search('/title/(tt.*)/\?.*', a.attrib.get('href'))
if m:
yield Movie(m.group(1), a.text)
woob-ec6516cf330dc1385c2faec2912c318c69b6da67-modules-imdb/modules/imdb/test.py 0000664 0000000 0000000 00000005461 13034501123 0026030 0 ustar 00root root 0000000 0000000 # -*- coding: utf-8 -*-
# Copyright(C) 2013 Julien Veyssier
#
# This file is part of weboob.
#
# weboob is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# weboob is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with weboob. If not, see .
from weboob.tools.test import BackendTest
class ImdbTest(BackendTest):
MODULE = 'imdb'
def test_search_movie(self):
movies = list(self.backend.iter_movies('spiderman'))
assert len(movies) > 0
for movie in movies:
assert movie.id
def test_get_movie(self):
movie = self.backend.get_movie('tt0079980')
assert movie
assert movie.id
assert movie.original_title
def test_search_person(self):
persons = list(self.backend.iter_persons('dewaere'))
assert len(persons) > 0
for person in persons:
assert person.id
def test_get_person(self):
person = self.backend.get_person('nm0223033')
assert person
assert person.id
assert person.name
assert person.birth_date
def test_movie_persons(self):
persons = list(self.backend.iter_movie_persons('tt0079980'))
assert len(persons) > 0
for person in persons:
assert person.id
assert person.name
assert person.short_description
def test_person_movies(self):
movies = list(self.backend.iter_person_movies('nm0223033'))
assert len(movies) > 0
for movie in movies:
assert movie.id
assert movie.original_title
def test_get_person_biography(self):
bio = self.backend.get_person_biography('nm0223033')
assert bio != ''
assert bio is not None
def test_get_movie_releases(self):
rel = self.backend.get_movie_releases('tt0079980', 'fr')
assert rel != ''
assert rel is not None
assert rel == 'France : 25 April 1979'
def test_iter_person_movies_ids(self):
movies_ids = list(self.backend.iter_person_movies_ids('nm0223033'))
assert len(movies_ids) > 0
for movie_id in movies_ids:
assert movie_id
def test_iter_movie_persons_ids(self):
persons_ids = list(self.backend.iter_movie_persons_ids('tt0079980'))
assert len(persons_ids) > 0
for person_id in persons_ids:
assert person_id