Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

imgur: download videos as mp4 instead of gif #520

Merged
merged 1 commit into from
Sep 13, 2021
Merged

imgur: download videos as mp4 instead of gif #520

merged 1 commit into from
Sep 13, 2021

Conversation

elipsitz
Copy link
Contributor

Some imgur URLS have the extension ".gifv" and show up as a gif,
even though they're actually supposed to be mp4 videos. Imgur
serves all videos/gifs as both .gif and .mp4. The image dict has
a key "prefer_video" to distinguish the two. This commit
overrides the .gif extension if "prefer_video" is true to ensure
we download the submission as originally intended.

Fixes #519

Two test cases were added to the imgur tests:

  1. https://i.imgur.com/j1CNCZY.gifv , which has prefer_video = False and should download as a gif
  2. https://i.imgur.com/uTvtQsw.gifv , which has prefer_video = True, and should download as an mp4

One test was updated -- it previously was downloading as a .gif and is now (correctly) downloading as an mp4.

Some imgur URLS have the extension ".gifv" and show up as a gif,
even though they're actually supposed to be mp4 videos. Imgur
serves all videos/gifs as both .gif and .mp4. The image dict has
a key "prefer_video" to distinguish the two. This commit
overrides the .gif extension if "prefer_video" is true to ensure
we download the submission as originally intended.
@aliparlakci
Copy link
Collaborator

LGTM, we can merge it after Serene takes a look. Thanks a lot for the contribution :)

Copy link
Owner

@Serene-Arc Serene-Arc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine, thanks for the contribution.

@Serene-Arc Serene-Arc merged commit 668fe80 into Serene-Arc:development Sep 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants