Remove splice and fix quotes

This commit is contained in:
Serene-Arc
2021-03-28 10:15:21 +10:00
committed by Ali Parlakci
parent 8bd4b8b3a9
commit f0d3cfefc0

View File

@@ -38,8 +38,10 @@ class Imgur(BaseDownloader):
@staticmethod @staticmethod
def _get_data(link: str) -> dict: def _get_data(link: str) -> dict:
if re.match(r".*i\.imgur\.com.*\.gifv$", link): if re.match(r'.*i\.imgur\.com.*\.gifv$', link):
link = link.replace("i.imgur", "imgur")[:-5] link = link.replace('i.imgur', 'imgur')
link = link.rstrip('.gifv')
res = requests.get(link, cookies={'over18': '1', 'postpagebeta': '0'}) res = requests.get(link, cookies={'over18': '1', 'postpagebeta': '0'})
if res.status_code != 200: if res.status_code != 200: