Skip to content

Commit

Permalink
Merge branch 'aliparlakci:development' into development
Browse files Browse the repository at this point in the history
  • Loading branch information
OMEGARAZER authored Jan 1, 2023
2 parents c4bece2 + b7aae72 commit 954df88
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bdfr/connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ def resolve_user_name(self, in_name: str) -> str:
def get_submissions_from_link(self) -> list[list[praw.models.Submission]]:
supplied_submissions = []
for sub_id in self.args.link:
if len(sub_id) == 6:
if len(sub_id) in (6, 7):
supplied_submissions.append(self.reddit_instance.submission(id=sub_id))
else:
supplied_submissions.append(self.reddit_instance.submission(url=sub_id))
Expand Down
2 changes: 1 addition & 1 deletion bdfr/site_downloaders/download_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def pull_lever(url: str) -> Type[BaseDownloader]:
sanitised_url = DownloadFactory.sanitise_url(url)
if re.match(r"(i\.|m\.)?imgur", sanitised_url):
return Imgur
elif re.match(r"(i\.)?(redgifs|gifdeliverynetwork)", sanitised_url):
elif re.match(r"(i\.|thumbs\d\.)?(redgifs|gifdeliverynetwork)", sanitised_url):
return Redgifs
elif re.match(r".*/.*\.[a-zA-Z34]{3,4}(\?[\w;&=]*)?$", sanitised_url) and not DownloadFactory.is_web_resource(
sanitised_url
Expand Down
1 change: 1 addition & 0 deletions tests/site_downloaders/test_download_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
("https://youtube.com/watch?v=Gv8Wz74FjVA", Youtube),
("https://redgifs.com/watch/courageousimpeccablecanvasback", Redgifs),
("https://www.gifdeliverynetwork.com/repulsivefinishedandalusianhorse", Redgifs),
("https://thumbs4.redgifs.com/DismalIgnorantDrongo-mobile.mp4", Redgifs),
("https://youtu.be/DevfjHOhuFc", Youtube),
("https://m.youtube.com/watch?v=kr-FeojxzUM", Youtube),
("https://dynasty-scans.com/system/images_images/000/017/819/original/80215103_p0.png?1612232781", Direct),
Expand Down
1 change: 1 addition & 0 deletions tests/test_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ def test_create_authenticator(downloader_mock: MagicMock):
("lvpf4l",),
("lvpf4l", "lvqnsn"),
("lvpf4l", "lvqnsn", "lvl9kd"),
("1000000",),
),
)
def test_get_submissions_from_link(
Expand Down

0 comments on commit 954df88

Please sign in to comment.