manolomartinez / greg

A command-line podcast aggregator
GNU General Public License v3.0
297 stars 37 forks source link

YouTube downloader #17

Closed manolomartinez closed 8 years ago

manolomartinez commented 10 years ago

Hey, @FilipBB, can you help me understand why something like this is needed? What it brings that greg currently cannot do?

I was thinking that perhaps with a bit extra work I could make something more general than a mere add-on for YT. Once I understand what it is doing.

FilipBB commented 10 years ago

Sure,

It's not so well know, but youtube, graciously (for now), provides rss feeds for every youtube "channel" (and even for public playlists). Although, normally, they would like users to follow channels using their subscription system, with a little investigation you can get the rss feed of any channel, and using this addition you can use greg to turn that rss feed into a podcast.

For example, I was looking for a podcast that keeps tracks of a certain professor's talks and posts them as audio files. There is no such podcast, but there is a youtube channel that posts his talks and uploads new ones (in video form). I got the rss feed for the channel, and with this addition, I use a handler, 'youtube-dl', to download updated videos automatically when they are posted and convert them to mp3. I think it is very useful, it basically turns any youtube channel into a podcast, and you don't have to use a browser to follow your youtube subscriptions.

The additions to greg are minor: greg simply checks if "youtube.com" is in the podcast url when there are episodes to download. From there, if it is not, it simply continues as normal using the download handler used for normal podcasts. If it is a youtube.com url, greg downloads the link using a different external handler, which must be specified in the config. This is necessary because youtube rss feeds give links to the youtube page, not to videos or audio directly. So you need an external handler that will parse the page the link points to and extract the video for download. There are many such programs, I use 'youtube-dl' which can also transcode the video file or extract the audio.

As for generalization, it may be possible, but the video site must provide rss feeds. There are some programs that are able to parse pages from different video sites for the video file ('python-you-get' or 'viget' for Vimeo, for example) which could be used for the backend work.

On Wed, Nov 6, 2013, at 06:52 AM, manolomartinez wrote:

Hey, [1]@FilipB, can you help me understand why something like this is needed? What it brings that greg currently cannot do?

I was thinking that perhaps with a bit extra work I could make something more general than a mere add-on for YT. Once I understand what it is doing.

Reply to this email directly or [2]view it on GitHub. [3wA8PlH62N_yDBXO3Mnyz3AtmyRhge-BCJTigKXFG0cIgv70PibJXwz3JYAqihUE.gif]

References

  1. https://github.com/FilipB
  2. https://github.com/manolomartinez/greg/issues/17
manolomartinez commented 10 years ago

All right, thanks a lot. Much clearer now. I was thinking of the following way to have a more general approach, that still gives you access to the right url: introducing a new field in greg.conf: ignoreenclosures, which will make greg ignore the presence or absence of enclosures, and simply do its thing for every entry. So, a YT feed would have the following section in greg.conf.

[MyYTfeed]

ignoreenclosures = yes downloadhandler = youtube-dl {link}

Would this approach, or a variation thereof, miss something?

FilipBB commented 10 years ago

Sure, I think that is a much better approach, it's a lot more flexible and lets the user handle the link as they wish, whether with a downloader, a custom script, or whatever.  From: manolomartinezSent: Wednesday, November 6, 2013 4:22 PMTo: manolomartinez/gregReply To: manolomartinez/gregCc: FilipBBSubject: Re: [greg] YouTube downloader (#17)All right, thanks a lot. Much clearer now. I was thinking of the following way to have a more general approach, that still gives you access to the right url: introducing a new field in greg.conf: ignoreenclosures, which will make greg ignore the presence or absence of enclosures, and simply do its thing for every entry. So, a YT feed would have the following section in greg.conf.

[MyYTfeed]

ignoreenclosures = yes downloadhandler = youtube-dl {link}

Would this approach, or a variation thereof, miss something?

—Reply to this email directly or view it on GitHub.

manolomartinez commented 10 years ago

The tip of development-main has this implemented now. Check it out if you can and let me know how it looks.

ghost commented 9 years ago

Hi I tried to use the ignoreenclosures option, but greg doesn't download anything while syncing. It works when I use greg check / greg download 0 though.

Youtube feed example (a french one): name: JoueurDuGrenier feed: https://www.youtube.com/feeds/videos.xml?channel_id=UC_yP2DpIgs5Y1uWC0T03Chw conf: [JoueurDuGrenier] ignoreenclosures = yes downloadhandler = youtube-dl {link} -o {directory}/{date}-{filename_title}

manolomartinez commented 9 years ago

Yep, I see what the problem is. Please install this test version, and let me know if it works:

pip install --index-url https://testpypi.python.org/pypi/ greg
ghost commented 9 years ago

It does!

I use greg daily for more than two years now, and I really like it. Thank you for your work.

manolomartinez commented 8 years ago

Why didn't I close this? The issue is fixed, isn't it? Oh, well.