Skip to content
/ YDL Public

🔥YouTube Downloader🔥 for downloading audio files 🎧, video files 🎞️, playlists of both video and audio ⏯️ at the preferred quality 📺 for free 🆓.

License

Notifications You must be signed in to change notification settings

greed2411/YDL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

78 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

YDL

YouTube Downloader (Synchronous)

A Python script to download Audio, Video and Playlist of audio and video files just by providing the URL and get them at the best quality.

For Asynchrnous go here

Tested and developed on Windows 7 32-bit SP1, Ubuntu GNOME 16.04 LTS, Ubuntu 16.10 and macOS Sierra 10.12.5

Command Line Programs Used

  • youtube-dl - Used to download the file from the internet
  • ffmpeg - Used for postprocess data, i.e., to convert file from .webm to .mp3 format

For Light weight script without error handling, run ydl-lite.py, you can skip the unnecessary library installations that way. But, you can't do monkey error testing with it.

Libraries used on Py 3.6.1 Anaconda, works with other py3 versions and distributions for ydl.py and ydl-windows.py.

  • subprocess - For running commands from python.
  • os - to get the current working directory.
  • urllib.request - For making GET methods
  • urllib.error - For considering URLError
  • sys - For exiting out of the script
  • bs4 - For scraping content while the user is connected to the internet or not, in case of wifi-connected , but not logged in
  • lxml - For parsing the HTML document

If you don't have either of the last two packages install them using,

pip install bs4

and

pip install lxml

If you don't have pip3 or pip go or dunno which one to use go here

Steps to follow for installing dependencies

  • On Windows

    1. Install youtube-dl via cmd

      pip install youtube-dl
      
    2. Install ffmpeg from here and the instructions

    3. And important thing : Move the contents of ffmpeg/bin/ to the location where youtube-dl.py is present as described in the issue

    4. Run the script ydl-windows.py via cmd

  • On Ubunutu or similar Distros

    1. Install youtube-dl via terminal

      pip install youtube-dl
      
    2. Install ffmpeg

      sudo apt-get install ffmpeg
      
    3. Run the scrpipt ydl.py in the terminal or the lightweight version ydl-lite.py.

* On macOS
  1. Install `youtube-dl` via terminal
     
        ```youtube-dl installation
     brew install youtube-dl
     ```
  2. Install `ffmpeg`
  
     ```ffmpeg installation
     brew install ffmpeg
     ```
  3. Run the scrpipt `ydl.py` in the terminal or the lightweight version `ydl-lite.py`.
  
   ### Possible errors: 
  
     It sometimes asks you to install 'pyattr' or the 'xattr' module, even GNU's 'attr' module by throwing an error

     Simple solution : 

     ```
     pip install xattr
     ```

References

Screenshots

Youtube link of playlist for audio downloads URL

Youtube link of playlist for audio downloads done

Facts you may love

  1. Your downloads resume, if your laptop falls asleep or enters sleep mode, assuming the terminal is still left open.
  2. In case of network error or out of storage, if you establish the connection back or clear someother storage for the sake of playlist, restart the script with the same link at the same location. It resumes downloading from the place where it left, instead of downloading the entire playlist again from the beginning.
  3. If you are concerned about the data usage like every other Indian (incl myself), don't worry quality control is present for video and video playlist downloads.

Contributor(s)

Thanks @MINOSai for quality control.

About

🔥YouTube Downloader🔥 for downloading audio files 🎧, video files 🎞️, playlists of both video and audio ⏯️ at the preferred quality 📺 for free 🆓.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages