-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CLI overhaul (+more) #895
CLI overhaul (+more) #895
Conversation
Flesihing out the ideas behing restructuring/recoding of spot-dl
The basic Ideas behind the restructuring attempt have been put down and will hopefully be updated as and when required. Now we can get straight to the code buisness.
Starting to work of the restructuring proper. You won't find any new code here but then a little design before coding can go a long way. I do my design via markdown, you should find a lot of that here. 😁
Some messups with the last commit and me trying to revert to a previous commit. Damn it should have been named 'Problems & Solutions III' well, here is the fix. The interface definitions have been finished. If I just figure out the code class dubbed soulOfSpotDl and the 'tools' proposed I can get down to code. Cheerio. 😁
Fixed up some inconspicious typos, ran some hacky tests, minor changes to interface definitons and some (in a way) working code.
Fixed some typo's, updated working docs, did some tests on logging in ./Hacks and got a working and configured heirarchal logger set up.
Nothing fancy here, just some typo fixes, guideline updates, design notes and recycled code.
Restructured Temp floder to resemble a python package. Minor name changes, a few edits, lots of questions and untested code. I might even have a hacky implementaion of the Metadata Search Interface.
Not much code this time around, was (re)figuring out the interfaces/object ideas, still have to change the docs to mirror the changes in code.
added the gener look up. did the doc strings...
Updated logging guidelines for more clarity of the resulting logs, updated the logging messages interspersed throughout the code to match the new guidelines, updated workingDocs. Chucked in a package diagram for good measure, it forces your to take stalk and stop roming around in circles. Put up the new stuff since 'Problems & Solutions I' under README updates.
Got in fresh embedding code that should work in theory, tests not yet done. Slight changes to the package diag. Some more minor folder renamings and stuff. One step closer to completion (4 more steps to go, assuming someone else will write the search provider which I'm hoping will be YTmusic) Thinking of ways to highlight the not so great function input variable 'v2_version=' used in mutagen, it tells you absolutely nothing about what the variable does.
Some typos and a lott of code... ༼ つ ◕_◕ ༽つ (Yayy!!!)
Was adding fresh functionality to spotifyHelpers.py and added a few more spotify-api responses to the REFS folder for reference
So, my ideas is to do the downloads and conversions in parrlell to speeden up things. Threading is not prrlell processing - multiprocess is. Fiddled around with multiprocessing. Tried calculating the SHA512 checksum for 33,326 files. single process ~ 25mins, 16 process (since I use a 8core Hyper-V processor) ~ just 3 mins. Far better than I expected.
Looking into various lobraries that can be used to download audio from YouTube and also into the speedy format conversion issue
Copied from the code I wrote for the original library. Includes "test" code.
Also updated objects.md with additional metadata suggestions.
Also updated objects.md with additional metadata suggestions.
Also includes (commented out) code to get metadata.
…potify-downloader into reStructure/reCode
YouTube Music's search response is a sprawling, over-nested JS Object. Code to filter out unnecessary data from those musked responses capable of handling all of the common response structures.
Wrote up a partial YouTube Music Based search Provider based off @roketinventors original code. I'm sure his version will be better
Got the search provider complete based of work done by @rocketinventor. He's the one who cracked YTM querys. Little tweaks to interface definitions.
The Metadata Search interface is no more. All completed classes have Doc Strings now.
…y-downloader into pr-testing-branch
The code is good, it looks awesome. There are a few functional errors, i'll try fixing them up but i'm not very thourough with your code so I'll probably ping you once in a while. Also, it would be good to shift back to multiprocessing as multiprocess doesn't really fix anything as of now. I'd rather keep spotify leas as possible - more dependencies, more likely something will go wrong. But,
|
Well, going through the code in detail to make required changes, reveals some minor design changes to be made. |
@Mikhail-Zex Thank you for looking. I will get around to resolving, commenting, etc hopefully later today. And don't worry about critiquing! Keep em coming! This is my first PR after all. |
Will review today |
…y-downloader into pr-testing-branch
This reverts commit 0f1f659.
Code is good. Your setup.py is broken. and i keep getting this error
|
@Mikhail-Zex, I am going to close this in favor of asyncio PR #994 . The asyncio implementation drastically changes (and potentially improves) the implementation of most of this code. I look forward to recreating a PR for prettier progress bars with updated code after the decision of an async library. Probably going to separate the argparse into a separate PR. |
Ok. |
CLI input
argparse
library for command-line argument handling.--spotify-client-id
and--spotify-client-secret
--debug
which can be set tolocal(default)/global/file
.local
only logs messages from root process.global
logs all logs from all scripts & libraries.file
outputs the (global) log to a file only.CLI feedback
New Progress bars!
rich
and not other libraries?rich
is a very supported library (13.3k stars, 45 devs), is updated regularly, and is very versatile.tqdm
, although also very supported, is not as "pretty"Multiprocessing Enhancements
Pool.starmap
is nowPool.starmap_async
to keep the main process running while the other (4) subprocesses are doing their thing. This opens the possibility for the main process to "keep an eye" on the other processes.queue
for process progress communicationdownload_song
now hastry: ... Except: ...
Exception handling with traceback to ensure exceptions get passed back to the main process.multiprocess
library switch. (NOTE: not multiprocessING)dill
instead ofpickle
& supports lambda functionsmultiprocessing
because of support.What else is included:
logging
with
wrappingsrequirements.txt
for pip(3) packages.pip3 install requirements.txt
to install needed requirements (without installing pip package.)There is a lot to review. I anything should be changed or does not follow contributing guidelines, feel free to let me know.
I will try to keep the pull request smaller from now on to prevent pulling overlapping interests/contributions. (Ex. C-String usage)