from a list of song to audio files on disk. The objective is to transform a shopping list of songs (text format) to a directory of audio files (mp3 with title and album metadata) on disk.
- read the input text file
- for each line of the file, a youtube search is started to check if a video clip or simple audio is available, then get the link of the file
- get file details
- download the file on disk
- extract audio and convert to mp3
- delete temporary files (video, convertion data)
- add to a playlist
searching using google api, you need a developper key, see https://developers.google.com/api-client-library/python/guide/aaa_apikeys https://developers.google.com/youtube/v3/code_samples/python https://developers.google.com/youtube/v3/code_samples/python#search_by_keyword
https://github.com/nficano/pytube pytube is a lightweight, dependency-free Python library (and command-line utility) for downloading YouTube Videos. the starting point si to get a link to the video to use this code. http://youtube.com/watch?v=9bZkp7q19f0
- start it
- use python 3.x
- overall objectives and specification
- run on windows
- use pytest
- test pytube
- test google api
- manage python unit test
- first python code extracts mp4 files
- run test using a list of 116 songs
- filter extra characters in the input list for robustness
- second python code extracts mp4 files and convert to mp3
- test playlist type search to get id of the playlist and get all the videos links using playlist items
- update code to manage playlist and playlist items [branch + pull request]
- test using known playlists of 50, 100 items
- test using bigger playlists
- wip
- run on linux
- run on mac OS
- dockers ?
-
Windows
python:
https://www.python.org/downloads/release/python-364/ffmpeg:
https://ffmpeg.zeranoe.com/builds/
(select static for 32 or 64 bit)google api:
pip install --upgrade google-api-python-clientsix:
pip install --upgrade sixprogress bar:
pip install --upgrade tqdmhttplib2:
pip3 install httplib2 --upgradegoogle dev key:
https://docs.simplecalendar.io/google-api-key/progress bar:
pip install tqdm --upgradeurllib:
pip3 install urllib3 --upgradetypical command line, don't define a path for the playlist, it will be stored in the audio output directory
<yourpath>\python.exe <yourpath>\pyAudioMain.py --inputlist <yourpath>\myinput.txt --devkey <yourgooglekey> --audiooutdir <yourpath> --playlist mytestplaylist.m3u8
-
Linux
wip
-
Mac OS
wip