blackjack4494 / youtube-dlc

Command-line program to download various media from YouTube.com and other sites
https://blackjack4494.github.io/youtube-dlc/
The Unlicense
1.22k stars 13 forks source link

Twitter shortener t.co redirect #186

Closed CeruleanSky closed 4 years ago

CeruleanSky commented 4 years ago

Please follow the guide below


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:

What is the purpose of your pull request?


Description of your pull request and other information

When getting urls from twitter they are usually of the type http://t.co and have the possibility of an additional gateway/redirect that needs to be stripped for youtube-dl to download in an automated/streamlined fashion.

blackjack4494 commented 4 years ago

Can you provide a sample link?

CeruleanSky commented 4 years ago

Here you go: https://twitter.com/tetexalinfini/status/1290024792880320513 Which is the source of the problem link https://t.co/SVVAyeyZfG?amp=1 which has the gateway "https://twitter.com/safety/unsafe_link_warning?unsafe_link=" , it really interferes when you are trying to download a bunch of videos off of twitter as you can run into it enough to see it as a wrench thrown in the gears. The amount of links and video sites that have that warning seems to increase every day, maybe the filter is too sensitive. In this case, Bitchute is a supported plugin, but that extra redirect causes the issue.

I'm sure gateway redirects will become more common as time goes on, perhaps they should eventually have their own section, but I don't know the ones from other sites.

blackjack4494 commented 4 years ago

I added a very simple extractor to twitter.

https://github.com/blackjack4494/youtube-dlc/blob/f33b7b5eb454ab182a3c8740875274469f5c3e0b/youtube_dlc/extractor/twitter.py#L613-L619

All you have to do is implementing the behaviour there.

blackjack4494 commented 4 years ago

Closing this in favor for #196