Fix gfycat after redgifs changes
This commit is contained in:
parent
a599169399
commit
f49a1d7a2d
2 changed files with 3 additions and 3 deletions
|
@ -21,7 +21,7 @@ class Gfycat(Redgifs):
|
|||
return super().find_resources(authenticator)
|
||||
|
||||
@staticmethod
|
||||
def _get_link(url: str) -> str:
|
||||
def _get_link(url: str) -> set[str]:
|
||||
gfycat_id = re.match(r'.*/(.*?)/?$', url).group(1)
|
||||
url = 'https://gfycat.com/' + gfycat_id
|
||||
|
||||
|
@ -39,4 +39,4 @@ class Gfycat(Redgifs):
|
|||
raise SiteDownloaderError(f'Failed to download Gfycat link {url}: {e}')
|
||||
except json.JSONDecodeError as 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):
|
||||
result = Gfycat._get_link(test_url)
|
||||
assert result == expected_url
|
||||
assert result.pop() == expected_url
|
||||
|
||||
|
||||
@pytest.mark.online
|
||||
|
|
Loading…
Reference in a new issue