WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: youtube-dl  (Read 32274 times)

Offline vinceASPECT

  • Hero Member
  • *****
  • Posts: 804
youtube-dl
« on: January 08, 2018, 07:04:45 PM »
Hello,

does anybody know the command that both shows all of the file types
available for a particular youtube movie link......and then can also show the url
of any of the listed file type option(s) that you choose....(not to actually download it)....

i can't quite get it.......i know "g" is somehow related to the url's

thx

V

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Re: youtube-dl
« Reply #1 on: January 08, 2018, 07:22:14 PM »
Code: [Select]
youtube-dl --list-formats "$URL"
Code: [Select]
youtube-dl -g --cookies /tmp/ytcookie --format 22 "$URL"
If it doesn't work I can post the script I made to automate this. Might be a little messy though.
Download a copy and keep it handy: Core book ;)

Offline vinceASPECT

  • Hero Member
  • *****
  • Posts: 804
Re: youtube-dl
« Reply #2 on: January 14, 2018, 03:56:11 PM »
yes thankyou...i figured out an approach

youtube-dl -f 17 -g (then the youtube movie link here)

this above just shows me the URL the file type assigned the listing number of 17 from a list of
about 19 different file types......

it's unusual becausae the list numbering has no real meaning.....so the positions that interest
me are 17 and 251

the listing just has no meaning or logical counting

eg (list below)

340--- some file type
26 -----some file type
----
---
----
---
290 ----some file type
---
---
215......mp4 360 file type
----
----
17 .......3gp 144 file type
----
-----

there are about 19 list entries in total

V

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Re: youtube-dl
« Reply #3 on: January 14, 2018, 06:19:36 PM »
Yep. Numbers.
Maybe the attached script is useful for you in some way. ;)
Download a copy and keep it handy: Core book ;)

Offline vinceASPECT

  • Hero Member
  • *****
  • Posts: 804
Re: youtube-dl
« Reply #4 on: January 18, 2018, 10:17:07 AM »
uh....yeah. -----i also tried to play live youtube videos in mplayer. First off i used youtube-dl with the live movie link and it listed some possible feeds. I grabbed one of the feeds  (93) and it then showed me the "DOTmu8" styled link for that feed.

Mplayer only played that video feed link for 10 secs then sputtered out  a "can't reverse seek in a stream" error.  I tried many switches like -cache etc but there was no improvement.......does anybody know how to solve that error pls?l

Played great for 10 secs....

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Re: youtube-dl
« Reply #5 on: February 01, 2018, 05:02:01 AM »
I don't know why it stops for you after 10 seconds.
I use that script pretty much every day to stream videos via smplayer. I made it due to laziness, in a non-lazy moment, so I don't have to remember the CLI options for video quality etc.
If it doesn't error out after 10 seconds when you use that script, instead of directly running mplayer with the content URL, you might be able to reproduce what the script does by checking which options are shipped over to mplayer.
I believe the  --cookie  option is kind of important also.
Download a copy and keep it handy: Core book ;)

Offline vinceASPECT

  • Hero Member
  • *****
  • Posts: 804
Re: youtube-dl
« Reply #6 on: February 07, 2018, 10:01:16 AM »
ahh Misalf...but are the movies you watch "live" streams from youtube?......youtube has an option called "live".

but anyhow, i have had a nightmare confirming with the BBC broadcasting corporation in the uk.......... about what types of youtube LIVE videos i am allowed to watch without a TV licence......there are some we can watch and some we can't...

V

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Re: youtube-dl
« Reply #7 on: February 07, 2018, 10:11:53 AM »
Sorry, no idea if live streams would work. My limited bandwidth wouldn't suffice.
I usually stream short videos in very low quality for informational purposes only.
Download a copy and keep it handy: Core book ;)

Offline vinceASPECT

  • Hero Member
  • *****
  • Posts: 804
Re: youtube-dl
« Reply #8 on: February 08, 2018, 09:05:14 AM »
well, it's nothing to do with bandwidth since the live streams are available in the same formats as any youtube "previously recorded video"  (any regular youtube video) on their site

it's the Protocol that is different. Live streams use a different protocol which mplayer doesn't quite like...infact Vlc does not like it either...

apparently only MPV can do live YT streaming. (a fork) but it's unclear if even mpv now works since youtube regularly changes it's code

I know that the only way to watch LIVE youtube videos within googles supposed remit (so to speak) is to use chrome browser and it needs to be a very recent edition....(some derivates of chrome may work....maybe Slimjet etc) but not many......FF may work..

V


Offline neonix

  • Wiki Author
  • Sr. Member
  • *****
  • Posts: 393
Re: youtube-dl
« Reply #9 on: January 16, 2019, 09:14:18 AM »
Is it possible to pipe youtube-dl output to mplayer? That I can watch video on-the-fly instead waiting until download end?

Offline mocore

  • Hero Member
  • *****
  • Posts: 649
  • ~.~
Re: youtube-dl
« Reply #10 on: January 16, 2019, 12:53:43 PM »

AFAIK you can read the file as it is being written!

did you try just opening the file as it is down loading ? ... 

Offline neonix

  • Wiki Author
  • Sr. Member
  • *****
  • Posts: 393
Re: youtube-dl
« Reply #11 on: January 17, 2019, 10:16:59 AM »

AFAIK you can read the file as it is being written!

did you try just opening the file as it is down loading ? ...
This is possible but not comfortable with very big and long videos.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11048
Re: youtube-dl
« Reply #12 on: January 17, 2019, 12:50:01 PM »
I think you can get youtube-dl to just print the video url, which you can then access with mplayer.
The only barriers that can stop you are the ones you create yourself.

Offline Pats

  • Sr. Member
  • ****
  • Posts: 322
Re: youtube-dl
« Reply #13 on: January 17, 2019, 03:40:33 PM »
I was thinking  , youtube-dl is to download a video for watching thru a video player ! :)

1) If the only purpose of OP is to view streaming videos,then this may be helpful ( prvsly read from net , not used ):
Quote
... Livestreamer is a Command Line Interface that pipes video streams from various services into a video player, such as VLC, Mplayer. The main purpose of Livestreamer is to allow the user to avoid buggy and CPU heavy flash plugins but still be able to enjoy various streamed content. 

Code: [Select]
livestreamer twitch.tv/day9tv
2) Some intersting links :

http://freesoftwaremagazine.com/articles/youtube_and_gnu_linux_download_and_convert_videos_easy_way

https://www.linuxlinks.com/youtube-dl-download-video-audio-files-streaming-sites

Offline vinceASPECT

  • Hero Member
  • *****
  • Posts: 804
Re: youtube-dl
« Reply #14 on: January 20, 2019, 11:22:41 AM »
Hi
Neonix.....i assume you did read the start of this whole thread....?

The answer to your later question is as Curaga stated to you.....youtube-dl will give you just the "viewable" URL address to any video......from any youtube video link you give youtube-dl

You then just paste that address into any media player and it will Stream and play the video. It's not downloading it.....as such.

so

a) .............$youtube-dl (Some youtube video link) -F       

.......that command above typed into your command prompt will show you all the LINKS for the particular youtube video link you gave it.

Then, for example below

b) ..............$youtube-dl -f 17 -g (same youtube video link)   

.....That command above in (b) will give you the URL of a particular FILE FORMAT (option 17) of the youtube video link you gave to youtube-dl.......it's an option you chose (17) from your listings results after executing command a) above

Then

c) ...............You take that LONG URL LINK result from (b) and copy and paste it into the OPEN URL option of any media player like mplayer and the video will STREAM and play. It isn't really downloading the video file, it;s streaming it.

-------------------------------------------------------
This stuff above is not true for ALL youtube videos. As the thread mentions, it's harder to playback LIVE youtube videos in media players.....but standard stuff works ok

thx

Vin

« Last Edit: January 20, 2019, 11:46:46 AM by vinceASPECT »