Fix gfycat after redgifs changes
This commit is contained in:
parent
71f84420cb
commit
7645319510
|
@ -21,7 +21,7 @@ class Gfycat(Redgifs):
|
||||||
return super().find_resources(authenticator)
|
return super().find_resources(authenticator)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _get_link(url: str) -> str:
|
def _get_link(url: str) -> set[str]:
|
||||||
gfycat_id = re.match(r'.*/(.*?)/?$', url).group(1)
|
gfycat_id = re.match(r'.*/(.*?)/?$', url).group(1)
|
||||||
url = 'https://gfycat.com/' + gfycat_id
|
url = 'https://gfycat.com/' + gfycat_id
|
||||||
|
|
||||||
|
@ -39,4 +39,4 @@ class Gfycat(Redgifs):
|
||||||
raise SiteDownloaderError(f'Failed to download Gfycat link {url}: {e}')
|
raise SiteDownloaderError(f'Failed to download Gfycat link {url}: {e}')
|
||||||
except json.JSONDecodeError as e:
|
except json.JSONDecodeError as e:
|
||||||
raise SiteDownloaderError(f'Did not receive valid JSON data: {e}')
|
raise SiteDownloaderError(f'Did not receive valid JSON data: {e}')
|
||||||
return out
|
return {out,}
|
||||||
|
|
|
@ -16,7 +16,7 @@ from bdfr.site_downloaders.gfycat import Gfycat
|
||||||
))
|
))
|
||||||
def test_get_link(test_url: str, expected_url: str):
|
def test_get_link(test_url: str, expected_url: str):
|
||||||
result = Gfycat._get_link(test_url)
|
result = Gfycat._get_link(test_url)
|
||||||
assert result == expected_url
|
assert result.pop() == expected_url
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.online
|
@pytest.mark.online
|
||||||
|
|
Loading…
Reference in a new issue