Skip to content

ern0/youda

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

youda.py

Youtube Downloader Automation

How to setup

  • download this script to your computer
  • install youtube-dl
    on a Mac: brew install youtube-dl
    on any OS: sudo pip install --upgrade youtube_dl
  • install a context-menu extension in your browser
    e.g. Context Menus for Chrome https://goo.gl/8hgwuB
  • add a custom action for links, which sends the URL to
    http://localhost:8009/?q=%s
    where "%s" is the variable name for the selected URL

Troubleshooting

How to use

  • start this script in a shell window:
    youda.py port [download-dir [check-dir [check-dir...]]]
    example: youda.py 8009 ~/Downloads/youtube /media/nexus7/storage/sdcard0/Podcasts/
    If you specify download-dirs, duplications will be also
    checked in these directories
  • in your browser, right-click in a YouTube link and
    select custom context menu item you've added
  • this script will catch the URL and call youtube-dl with it

Under the hood

  • when you add a file, the web server thread creates a placeholder file
  • the processing thread scans the directory, picks first placeholder file, then replaces it with the downloaded file
  • upon counter overflow, the items above 555 will appear before others, e.g. the order will be: 910, 911, 922, 930, 001, 002, 003
  • because the queue is stored in files, script can be restarted