gregoryxie / nicer-rack

MIT License
0 stars 0 forks source link

Implement pytube link extraction and downloading #2

Closed tristan1049 closed 2 years ago

tristan1049 commented 2 years ago

Created pytube link data extraction and mp3 audio file downloading capabilities. Also created a requirements.txt file to place all imports into that need to be installed before anything is run.

To run the pip3 install commands in the requirements.txt file, run pip3 install -r requirements.txt I'll add this to the README as well.

The extract_link_data() function takes a YouTube link, cleans the link into 'youtube.../v?...' format, and downloads the audio into a 'audio_files' folder that gets created upon the method call if it doesn't exist. Returns a tuple of the video title, length, cleaned link, relative filepath from the root folder, and thumbnail url.

Note that pytube3 is listed before pytube in the requirements.txt file, which is necessary as the order of pip3 install commands matters due to some pytube import dependency. Long story short, just have pytube3 before pytube in the requirements.txt file.