1
0
Fork 0
mirror of synced 2024-06-26 18:10:26 +12:00

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
def _get_data(link: str) -> dict:
if re.match(r".*i\.imgur\.com.*\.gifv$", link):
link = link.replace("i.imgur", "imgur")[:-5]
if re.match(r'.*i\.imgur\.com.*\.gifv$', link):
link = link.replace('i.imgur', 'imgur')
link = link.rstrip('.gifv')
res = requests.get(link, cookies={'over18': '1', 'postpagebeta': '0'})
if res.status_code != 200: