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

[gfycat] support when accidentally prodiving media uri #22225

Merged
merged 2 commits into from
Oct 4, 2019
Merged

[gfycat] support when accidentally prodiving media uri #22225

merged 2 commits into from
Oct 4, 2019

Conversation

AnhNhan
Copy link
Contributor

@AnhNhan AnhNhan commented Aug 26, 2019

Please follow the guide below

  • You will be asked some questions, please read them carefully and answer honestly
  • Put an x into all the boxes [ ] relevant to your pull request (like that [x])
  • Use Preview tab to see how your pull request will actually look like

Before submitting a pull request make sure you have:

In order to be accepted and merged into youtube-dl each piece of code must be in public domain or released under Unlicense. Check one of the following options:

  • I am the original author of this code and I am willing to release it under Unlicense
  • I am not the original author of this code but it is in public domain or released under Unlicense (provide reliable evidence)

What is the purpose of your pull request?

  • Bug fix
  • Improvement
  • New extractor
  • New feature

Description of your pull request and other information

When pasting gfycat URLs copied from the browser, or pasting URLs shared via chat/social media, links are often provided as direct media urls, e.g.

https://thumbs.gfycat.com/acceptablehappygoluckyharborporpoise-size_restricted.gif
https://giant.gfycat.com/acceptablehappygoluckyharborporpoise.mp4

youtube-dl had downloaded these URLs using the generic extractor, though using the gfycat extractor would yield the best results (and not simply download the reduced gif preview).

I have verified that my changes work by adding tests and running tests/test_all_urls.py and also running it myself on the Terminal.

C:\Users\anhnh\dev\youtube-dl (gfycat-contenturls)
λ python -m youtube_dl https://thumbs.gfycat.com/DopeyBigAfricanclawedfrog-max-1mb.gif
[Gfycat] DopeyBigAfricanclawedfrog: Downloading video info
[download] Destination: a saerom-fromis 180727 [UeBMgvOQmR8]-9-DopeyBigAfricanclawedfrog.mp4
[download] 100% of 663.43KiB in 00:01

C:\Users\anhnh\dev\youtube-dl (gfycat-contenturls)
λ python -m youtube_dl https://giant.gfycat.com/DefinitePlayfulAmazonparrot.webm
[Gfycat] DefinitePlayfulAmazonparrot: Downloading video info
[download] Destination: saerom-fromis 180727 [UeBMgvOQmR8]-6-DefinitePlayfulAmazonparrot.mp4
[download] 100% of 203.81KiB in 00:01

Note that the gfycat extractor has been selected and the info dict provided the video title.

youtube_dl/extractor/gfycat.py Outdated Show resolved Hide resolved
@AnhNhan AnhNhan requested a review from dstftw September 23, 2019 07:41
@dstftw dstftw merged commit 0b87bee into ytdl-org:master Oct 4, 2019
meunierd referenced this pull request in meunierd/youtube-dl Feb 13, 2020
pareronia referenced this pull request in pareronia/youtube-dl Jun 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants