Giter Club home page Giter Club logo

youtube-downloader's Introduction

youtube-downloader

Downloads YouTube videos in the desired quality.

Installation:

Source code

cd $folderToInstall
git clone https://github.com/neonzada/youtube-downloader.git

Dependencies:

cd $folderToInstall/youtube-downloader
pip install -r ./dependencies.txt

Usage

The program has to be executed within the youtube-downloader/source where all of its modules are located. So to run the program you need to:

cd $folderToInstall/youtube-downloader/source
python main.py
  • To change videos and audios output path:

    in the main.py do the following changes:

    # FROM:
    OUTPUT_VIDEO = path.join(getcwd(), "..", "videos")
    OUTPUT_AUDIO = path.join(getcwd(), "..", "audios")
    
    # TO:
    OUTPUT_VIDEO = r"your_desired_path_for_videos" 
    OUTPUT_AUDIO = r"your_desired_path_for_audios"

    The settings menu on the GUI is currently on development, so this is the current way to change it

youtube-downloader's People

Contributors

yadard avatar zazadev avatar

Stargazers

 avatar  avatar

Watchers

 avatar

youtube-downloader's Issues

Horrible performance issue during fetching and/or rendering of data

During the fetching o data that occurs in the following function:

main.py:

# Aplication.onSubmit:
def onSubmit(self, entry: GUI.QueryEntry, event: Event):
        search = self.search['Search']
        search.content.clear()

        if not entry._place_holder:
            try:
                vid = API.parseURL(entry.entry.get())
            except Exception as e:
                print(e)
                return
            
            videos = API.parseVideos(vid)
            temp = lambda v,e: threading.Thread(name="OnClickVideo", target=self.onClick, args=(v,e)).start()
            API.populate(videos, self.videos, Video, self.after, search.content.addItem, 6, offset=(0,5), bind=(["<1>"], temp))

This block of code do a lot of networking with requests and threads , the slow down on the GUI could be due to the main thread having to keep jumping between GUI's calls during the rendering of the fetched data. If that's the case, we need to somehow make the GUI's calls be executed in different threads, not only the main thread on Tk.mainloop.

Resolutions limitation due to the fact that some streams aren't progressive

Streams with mime_type=='video/mp4' that aren't progressive don't have sound due to this reason.

Meaning that our only work around would be downloading the 'audio/mp4' and the 'video/mp4' streams separately and somehow putting those two together, a quick and easy way to do this is using moviepy but performance wise this would be a disaster a 20+ minutes video would that almost 30 minutes to finish rendering.

To see how big of a issue this is, take a look at this random video I fetched with pytube:

progressives:

    <Stream: itag="18" mime_type="video/mp4" res="360p" fps="30fps" vcodec="avc1.42001E" acodec="mp4a.40.2" progressive="True" type="video">
    <Stream: itag="22" mime_type="video/mp4" res="720p" fps="30fps" vcodec="avc1.64001F" acodec="mp4a.40.2" progressive="True" type="video">

non_progressives:

    <Stream: itag="160" mime_type="video/mp4" res="144p" fps="30fps" vcodec="avc1.4d400c" progressive="False" type="video">
    <Stream: itag="133" mime_type="video/mp4" res="240p" fps="30fps" vcodec="avc1.4d4015" progressive="False" type="video">
    <Stream: itag="134" mime_type="video/mp4" res="360p" fps="30fps" vcodec="avc1.4d401e" progressive="False" type="video">
    <Stream: itag="135" mime_type="video/mp4" res="480p" fps="30fps" vcodec="avc1.4d401f" progressive="False" type="video">
    <Stream: itag="298" mime_type="video/mp4" res="720p" fps="60fps" vcodec="avc1.4d4020" progressive="False" type="video">
    <Stream: itag="299" mime_type="video/mp4" res="1080p" fps="60fps" vcodec="avc1.64002a" progressive="False" type="video">

In this scenario, the only resolutions available with audio for this video are 360p and 720p. It was lost more than half of the available options.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.