Merge pull request #681 from linaspurinis/master

adding /json to the end of url
pull/685/head
meisnate12 3 years ago committed by GitHub
commit 1b7652ba9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -52,6 +52,8 @@ class Mdblist:
logger.info(f"Processing Mdblist.com List: {data['url']}{limit_status}") logger.info(f"Processing Mdblist.com List: {data['url']}{limit_status}")
parsed_url = urlparse(data["url"]) parsed_url = urlparse(data["url"])
url_base = parsed_url._replace(query=None).geturl() url_base = parsed_url._replace(query=None).geturl()
url_base = url_base if url_base.endswith("/") else f"{url_base}/"
url_base = url_base if url_base.endswith("json/") else f"{url_base}json/"
params = {"limit": data["limit"]} if data["limit"] > 0 else None params = {"limit": data["limit"]} if data["limit"] > 0 else None
return [(i["imdb_id"], "imdb") for i in self.config.get_json(url_base, headers=headers, params=params)] return [(i["imdb_id"], "imdb") for i in self.config.get_json(url_base, headers=headers, params=params)]
else: else:

Loading…
Cancel
Save