Live data from Hacker News

Ytdl-webserver: Webserver for downloading YouTube videos

github.com

61–70 of 71 posts

Re: Ytdl-webserver: Webserver for downloading YouTube videos

#62
post #57
post #19

It's not as slickly packaged, but I made a webserver that turns YouTube channels into proper RSS subscribe-able audio podcasts: https://github.com/frou/yt2pod If you find yourself often having your phone in your pocket with the screen blazing, just to be able to listen to YT content, you might like it. (it's on the todo list to Dockerize it)

Did you know iOS podcasts supports video podcasts? Haven’t looked at your code but maybe wouldn’t be too much work to make video work too. I’ll talk a look. Thanks! I’ve thought that it would be a great way to avoid the algorithm addiction and only see my subs.

That's in fact already supported, but I didn't document it because I felt it muddied the pitch.

https://github.com/frou/yt2pod/blob/31b55410c38dbf655b641eee...

Add this per-podcast in the config file:

"vidya": true

I hear you about not wanting to spend too much time in the circus.

Re: Ytdl-webserver: Webserver for downloading YouTube videos

#63

Is there a way to download Netflix videos too? My reason is I just can't watch anything at less than 1.5X speed nowadays and Netflix has no such option on mobile (there is a chrome extension though). Any ideas how to do either (dl or increase playback speed on mobile)

+1. The lack of 2x playback speed makes documentaries on Netflix unwatchable. Third-party Chrome extensions of unknown origin doesn't seem like a good idea.

Unfortunately, easier to stick to YouTube and VLC for documentary watching.

Re: Ytdl-webserver: Webserver for downloading YouTube videos

#64
built a simple MacOS Safari extension that sends the current url to my server, which then runs a simple script to download using youtube-dl. I then use my iPad to view the videos using the nPlayer which can read NFS shares. very useful for downloading and viewing videos from variety of "alternate" video sites

Re: Ytdl-webserver: Webserver for downloading YouTube videos

#65

Is there a way to download Netflix videos too? My reason is I just can't watch anything at less than 1.5X speed nowadays and Netflix has no such option on mobile (there is a chrome extension though). Any ideas how to do either (dl or increase playback speed on mobile)

+1. The lack of 2x playback speed makes documentaries on Netflix unwatchable. Third-party Chrome extensions of unknown origin doesn't seem like a good idea. Unfortunately, easier to stick to YouTube and VLC for documentary watching.

Get Greasemonkey and you can limit the video speed controller to certain websites or turn it off when you're not using it. (And also disable auto update of the script).

Re: Ytdl-webserver: Webserver for downloading YouTube videos

#66
post #50

Earlier quoted context omitted.

To my knowledge there isn't a way to bypass its DRM atm (to directly download a file).

It's certainly possible, look for the various groups releasing untouched Netflix video on your favourite filesharing platform. They're not about to make their method public though, and last I read up on it I don't think they can do 4k? But SD/720p/1080p is all there.

I believe 4k uses hdcp to your monitor, but the other formats are as simple as screen capturing.

Re: Ytdl-webserver: Webserver for downloading YouTube videos

#67

In my experience, YouTube-dl needs to be updated quite frequently, as YouTube changes their design. How is this handled here? Is periodically kill / restart the container enough?

I added a travis cron job to update the image daily: https://github.com/Algram/ytdl-webserver/pull/6 and another guy came around and made the image even more friendly for automatic updates https://github.com/Algram/ytdl-webserver/pull/7

So if you ever run into issues you would just pull the latest container.

Re: Ytdl-webserver: Webserver for downloading YouTube videos

#68

Earlier quoted context omitted.

On iOS I’ve installed Pythonista with Stash, pip installed YouTube-dL, set up a script to take a link and download it to mp4 and share it an app (usually VLC). This can be triggered from YouTube app by pressing Share, then Pythonista script then the custom script, wait for download then select VLC. It’s not great for big videos but was extremely satisfying to set up.

Anything you can share code wise, curious to learn more.

Here's an example:

  #!python3
  """Open url in VLC — Pythonista for iOS app extension.
  
  1. take media url from appex(share)/clipboard/command-line
  2. open it in VLC iphone app
  
  e.g., to listen to Youtube video in the background.
  
  It accepts a media url from any site supported by youtube_dl 
  https://rg3.github.io/youtube-dl/supportedsites.html
  """
  import sys
  from urllib.parse import quote
  
  import youtube_dl
  
  import appex
  import clipboard
  import console
  
  import appex_webbrowser as webbrowser
  
  def open(webpage_url):
      """Play media on *webpage_url* in VLC"""
      with youtube_dl.YoutubeDL(dict(forceurl=True)) as ydl:
          r = ydl.extract_info(webpage_url, download=False)
          media_url = r['formats'][-1]['url']
      # play the url in VLC
      # vlc:// + url leads to a popup
      # https://wiki.videolan.org/Documentation:IOS/#x-callback-url
      webbrowser.open('vlc-x-callback://x-callback-url/stream?url=' + quote(media_url) )
      
  
  def main():
      if not appex.is_running_extension():
          if len(sys.argv) == 2:
              url = sys.argv[1]
          else:
              url = clipboard.get()
      else:
          url = appex.get_url() or appex.get_text()
      if url:
          open(url)
          console.hud_alert('Done.')
      else:
          console.hud_alert('No input URL found.')
  
  if __name__ == '__main__':
      console.show_activity()
      try:
          main()
      finally:
          console.hide_activity()
where appex_webbrowser.py is:

  """webbrowser.open() replacement for app extensions in Pythonista for iOS.
  """
  from objc_util import nsurl,UIApplication
  
  
  def open(url):
      app = UIApplication.sharedApplication()
      app.openURL_(nsurl(url))

Re: Ytdl-webserver: Webserver for downloading YouTube videos

#69
post #24

Earlier quoted context omitted.

On iOS I’ve installed Pythonista with Stash, pip installed YouTube-dL, set up a script to take a link and download it to mp4 and share it an app (usually VLC). This can be triggered from YouTube app by pressing Share, then Pythonista script then the custom script, wait for download then select VLC. It’s not great for big videos but was extremely satisfying to set up.

This is great! Does it also support play background music that you download as a .m4a ?

VLC does yes. That said the real issue is that the download part can’t run in background for more than 4 minutes, so you can’t download big videos.

Re: Ytdl-webserver: Webserver for downloading YouTube videos

#70
post #68

Earlier quoted context omitted.

Anything you can share code wise, curious to learn more.

Here's an example: #!python3 """Open url in VLC — Pythonista for iOS app extension. 1. take media url from appex(share)/clipboard/command-line 2. open it in VLC iphone app e.g., to listen to Youtube video in the background. It accepts a media url from any site supported by youtube_dl https://rg3.github.io/youtube-dl/supportedsites.html """ import sys from urllib.parse import quote import youtube_dl import appex impor…

Wow that’s way better than mine. I still find coding with two thumbs on an iPhone se does not fully make use of Pythonista. But there’s no way I’d buy an iPad that doesn’t have BT mouse support.
Post reply on HN