Redgifs updates

Update Redgifs regex for further edge case.

Add test for checking ID.
This commit is contained in:
Soulsuck24
2022-12-24 20:52:45 -05:00
parent 816b7e2726
commit fe9cc7f29f
2 changed files with 20 additions and 2 deletions

View File

@@ -10,6 +10,19 @@ from bdfr.resource import Resource
from bdfr.site_downloaders.redgifs import Redgifs
@pytest.mark.parametrize(
("test_url", "expected"),
(
("https://redgifs.com/watch/frighteningvictorioussalamander", "frighteningvictorioussalamander"),
("https://www.redgifs.com/watch/genuineprivateguillemot/", "genuineprivateguillemot"),
("https://www.redgifs.com/watch/marriedcrushingcob?rel=u%3Akokiri.girl%3Bo%3Arecent", "marriedcrushingcob"),
),
)
def test_get_id(test_url: str, expected: str):
result = Redgifs._get_id(test_url)
assert result == expected
@pytest.mark.online
@pytest.mark.parametrize(
("test_url", "expected"),