[GH-ISSUE #27] feat: add cli utility #18

Open
opened 2026-03-04 12:28:02 +03:00 by kerem · 11 comments
Owner

Originally created by @saikhurana98 on GitHub (Oct 22, 2022).
Original GitHub issue: https://github.com/casualsnek/onthespot/issues/27

Hey,
First of all, thank you so much for creating this application. It's amazing what you've done here. It's by far the most advanced Spotify downloader I've seen.
I know you're looking to refactor the code and make a newer ui but i would love a cli interface. I want to automate downloads therefore it would be awesome if there was a simple cli interface. just a basic one that takes in the "track id "and spilts out the mp3 file is perfect.

Originally created by @saikhurana98 on GitHub (Oct 22, 2022). Original GitHub issue: https://github.com/casualsnek/onthespot/issues/27 Hey, First of all, thank you so much for creating this application. It's amazing what you've done here. It's by far the most advanced Spotify downloader I've seen. I know you're looking to refactor the code and make a newer ui but i would love a cli interface. I want to automate downloads therefore it would be awesome if there was a simple cli interface. just a basic one that takes in the "track id "and spilts out the mp3 file is perfect.
Author
Owner

@PassiveLemon commented on GitHub (Oct 24, 2022):

I would also like this feature. Configs could potentially be done in a config file or through arguments entered with command which would allow for full automation. Being able to have this run on a set schedule would help the hands-off functionality of my media server.
An example could be onthespot.py -nogui -config.txt -link=spotifylink and in the config.txt would be lines like:

account1=email@email.com
password1=123456
max_download_workers=1
parsing_account_sn=1
etc
etc

which would use the provided commands to download that Spotify link. If you don't want to use the config file, you could just run the command like:
onethespot.py -nogui -account1=email@email.com -etc -etc

You could add addition accounts with account#, password# or something of the likes. They could potentially also be hashed in some way so they aren't stored in plain text.

One thing I would like to see is a setting to remove songs that aren't in your playlist. Can just be a simple toggle that checks the songs downloaded from the songs in the playlist, compares them with the songs that are currently stored on disk and removes the ones that do not belong. This could have issues if the songs are downloaded like author/album/song.mp3 but I'm sure there is an effective way to figure this out.

<!-- gh-comment-id:1289649048 --> @PassiveLemon commented on GitHub (Oct 24, 2022): I would also like this feature. Configs could potentially be done in a config file or through arguments entered with command which would allow for full automation. Being able to have this run on a set schedule would help the hands-off functionality of my media server. An example could be `onthespot.py -nogui -config.txt -link=spotifylink` and in the config.txt would be lines like: ``` account1=email@email.com password1=123456 max_download_workers=1 parsing_account_sn=1 etc etc ``` which would use the provided commands to download that Spotify link. If you don't want to use the config file, you could just run the command like: `onethespot.py -nogui -account1=email@email.com -etc -etc` You could add addition accounts with account#, password# or something of the likes. They could potentially also be hashed in some way so they aren't stored in plain text. One thing I would like to see is a setting to remove songs that aren't in your playlist. Can just be a simple toggle that checks the songs downloaded from the songs in the playlist, compares them with the songs that are currently stored on disk and removes the ones that do not belong. This could have issues if the songs are downloaded like `author/album/song.mp3` but I'm sure there is an effective way to figure this out.
Author
Owner

@casualsnek commented on GitHub (Oct 25, 2022):

I plan on doing this but it may take some time for refactoring and new code for cli support. Since the threads for downloading and all other depend on QThread an elegant cli can be difficult. CLI with same featureset of GUI can get some limitation like cli instance downloaing 'now playing' from desktop session and another instance downloading a playlist will almost fail.

I have some alternate plans to achieve automation and scripting with onthespot, maybe we can discuss how it should go on discord ?

<!-- gh-comment-id:1290298862 --> @casualsnek commented on GitHub (Oct 25, 2022): I plan on doing this but it may take some time for refactoring and new code for cli support. Since the threads for downloading and all other depend on QThread an elegant cli can be difficult. CLI with same featureset of GUI can get some limitation like cli instance downloaing 'now playing' from desktop session and another instance downloading a playlist will almost fail. I have some alternate plans to achieve automation and scripting with onthespot, maybe we can discuss how it should go on discord ?
Author
Owner

@PassiveLemon commented on GitHub (Oct 25, 2022):

Discord link is currently invalid

<!-- gh-comment-id:1291004278 --> @PassiveLemon commented on GitHub (Oct 25, 2022): Discord link is currently invalid
Author
Owner

@casualsnek commented on GitHub (Oct 26, 2022):

Discord link is currently invalid

I have updated it in readme ! Can you try now ?

<!-- gh-comment-id:1292080862 --> @casualsnek commented on GitHub (Oct 26, 2022): > Discord link is currently invalid I have updated it in readme ! Can you try now ?
Author
Owner

@PassiveLemon commented on GitHub (Oct 26, 2022):

Yup, it works now.

<!-- gh-comment-id:1292497567 --> @PassiveLemon commented on GitHub (Oct 26, 2022): Yup, it works now.
Author
Owner

@RandomLegend commented on GitHub (Jun 12, 2023):

Hey,

I'd love to have a simple CLI functionality aswell. I want to run this on my server so that my PC doesn't need to be turned on while downloading.

Any chance i can get the testcode aswell? :-D

<!-- gh-comment-id:1587109594 --> @RandomLegend commented on GitHub (Jun 12, 2023): Hey, I'd love to have a simple CLI functionality aswell. I want to run this on my server so that my PC doesn't need to be turned on while downloading. Any chance i can get the testcode aswell? :-D
Author
Owner

@casualsnek commented on GitHub (Jun 12, 2023):

Hey,

I'd love to have a simple CLI functionality aswell. I want to run this on my server so that my PC doesn't need to be turned on while downloading.

Any chance i can get the testcode aswell? :-D

A better rewrite of this project is planned and will probably add support for multiple user interface types. It will take a few weeks for me to start the rewrite as i'm currently busy due to academic works !

Sorry, i didn't get what you mean by testcode tho !

<!-- gh-comment-id:1587761055 --> @casualsnek commented on GitHub (Jun 12, 2023): > Hey, > > I'd love to have a simple CLI functionality aswell. I want to run this on my server so that my PC doesn't need to be turned on while downloading. > > Any chance i can get the testcode aswell? :-D A better rewrite of this project is planned and will probably add support for multiple user interface types. It will take a few weeks for me to start the rewrite as i'm currently busy due to academic works ! Sorry, i didn't get what you mean by testcode tho !
Author
Owner

@RandomLegend commented on GitHub (Jun 12, 2023):

Alright, are you planning on doing something docker-wise? Maybe even give it a quick and dirty webUI?

That would be astronomical!

<!-- gh-comment-id:1587763502 --> @RandomLegend commented on GitHub (Jun 12, 2023): Alright, are you planning on doing something docker-wise? Maybe even give it a quick and dirty webUI? That would be astronomical!
Author
Owner

@casualsnek commented on GitHub (Jun 12, 2023):

Alright, are you planning on doing something docker-wise? Maybe even give it a quick and dirty webUI?

That would be astronomical!

I have plans for a qt, commandline interface as well as http API too !

<!-- gh-comment-id:1587766306 --> @casualsnek commented on GitHub (Jun 12, 2023): > Alright, are you planning on doing something docker-wise? Maybe even give it a quick and dirty webUI? > > That would be astronomical! I have plans for a qt, commandline interface as well as http API too !
Author
Owner

@RandomLegend commented on GitHub (Jun 12, 2023):

Fantastic, thank you! :-)

<!-- gh-comment-id:1587767227 --> @RandomLegend commented on GitHub (Jun 12, 2023): Fantastic, thank you! :-)
Author
Owner

@RandomLegend commented on GitHub (Feb 25, 2024):

@casualsnek - Hey mate! Just wanted to stop by and ask if you have a eta for the rework? Or "atleast" for the CLI mode?

<!-- gh-comment-id:1962887794 --> @RandomLegend commented on GitHub (Feb 25, 2024): @casualsnek - Hey mate! Just wanted to stop by and ask if you have a eta for the rework? Or "atleast" for the CLI mode?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/onthespot#18
No description provided.