Fix gfycat after redgifs changes
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user