HTTP headers should always be an argument of the Request object

This commit is contained in:
Fabio Manganiello 2019-09-02 01:17:52 +02:00
parent e673b3e0c7
commit 1dca11c0be

View file

@ -160,8 +160,8 @@ class TorrentPlugin(Plugin):
for show in shows: for show in shows:
request = urllib.request.urlopen(urllib.request.Request( request = urllib.request.urlopen(urllib.request.Request(
'https://tv-v2.api-fetch.website/show/' + show.get('_id')), 'https://tv-v2.api-fetch.website/show/' + show.get('_id'),
headers=self.headers) headers=self.headers))
show = json.loads(request.read().decode('utf-8')) show = json.loads(request.read().decode('utf-8'))
@ -209,8 +209,8 @@ class TorrentPlugin(Plugin):
for show in shows: for show in shows:
request = urllib.request.urlopen(urllib.request.Request( request = urllib.request.urlopen(urllib.request.Request(
'https://anime.api-fetch.website/anime/' + show.get('_id')), 'https://anime.api-fetch.website/anime/' + show.get('_id'),
headers=self.headers) headers=self.headers))
show = json.loads(request.read().decode('utf-8')) show = json.loads(request.read().decode('utf-8'))