pass timeout

This commit is contained in:
j 2025-01-28 18:19:48 +05:30
commit bf140a7ce3

View file

@ -578,7 +578,7 @@ class Imdb(SiteParser):
pass
#self['connections'] = movie_connections(self.get_page_data('movieconnections'))
self['connections'] = self._get_connections()
self['connections'] = self._get_connections(timeout)
spec = tech_spec(self.get_page_data('technical'))
for key in spec:
@ -685,7 +685,7 @@ class Imdb(SiteParser):
self['episodeDirector'] = self['director']
self['director'] = self['creator']
def _get_connections(self):
def _get_connections(self, timeout=-1):
query = '''query {
title(id: "tt%s") {
id
@ -725,7 +725,7 @@ class Imdb(SiteParser):
#response = requests.post(url, json=
response = json.loads(read_url(url, data=json.dumps({
"query": query
}), headers=headers))
}), headers=headers, timeout=timeout))
connections = {}
for c in response['data']['title']['connections']['edges']:
cat = c['node']['category']['text']