Git Product home page Git Product logo

onthespot's Introduction

Logo

Onthespot

qt based music downloader written in python.

Screenshot

Discord for discussions: Discord Invite

If you have an idea for an improvement or feature, create a issue or join the discord server to discuss!

1. Installing/launching application:

1.1. Launch without installing - from source

Make sure ffmpeg, python3 and Git are installed and available on your $PATH. If you are on windows, you also need to install the Microsoft C++ build tools and restart your computer before starting the build process.

  1. Download or Clone the repo git clone https://github.com/casualsnek/onthespot
  2. Navigate to the onthespot directory cd onthespot
  3. Install the package pip install -r requirements.txt
  4. Navigate to source directory cd src
  5. Launch the application with python3 -m onthespot

1.2. Launch with installing - from source

The requirements are the same as "Launching without installing" above.

  1. Download or Clone the repo git clone https://github.com/casualsnek/onthespot
  2. Navigate to the onthespot directory cd onthespot
  3. Build the package python -m build
  4. Install the package pip install ./dist/*.whl
  5. Launch the application with onthespot_gui

1.3. Using portable prebuilt binaries

On Linux

Arch Linux

onthespot is available for arch linux and arch linux based distributions in arch user repository (aur) as onthespot-git.

You can install onthespot using your favourite aur helper.

For eg: using yay

yay -Sy onthespot-git

Other Distributions

Download Latest 'onthespot_linux' from the release section and execute with

chmod +x onthespot_linux
./onethespot_linux

On Windows

Download Latest 'onthespot_win_ffm.exe' or 'onthespot_win.exe' from the Release section and execute by double-clicking the downloaded file.

The binaries with filename ending with '_ffm' have ffmpeg bundled and should not require manual installation.

If you are using binaries that does not bundle ffmpeg and downloads gets stuck at 99% with Converting on progress text, you are missing ffmpeg ! Please install it by following the instructions below

Installing ffmpeg in windows

  • Open Windows Explorer and Navigate to C:\ Drive and make a folder name ffmpeg there
  • Download ffmpeg zip from https://www.gyan.dev/ffmpeg/builds/ffmpeg-release-full.7z then copy the bin folder from zip to C:\ffmpeg
  • Open CMD as administrator and run the command: setx /m PATH "C:\ffmpeg\bin;%PATH%"

Now the application should work as expected.

2. Building/packaging manually

Building or packaging on any OS requires Git, Python3 and Pip installed. Make sure you have them installed !

2.1. Building portable binaries

2.1.1 On Linux/nix

Open terminal emulator and run the following command to clone the repository and build.

git clone https://github.com/casualsnek/onthespot
cd onthespot

If you want builds with ffmpeg embedded download ffmpeg binaries for your os from Here. Create a new directory named 'ffbin_nix' in repository root directory. Copy three files 'ffmpeg', 'ffprobe', 'ffplay' from downloaded archive to just created 'ffbin_nix' directory then run;

bash ./build_linux.sh

After the command completes, you should have a 'dist' directory in repository root containing built 'onthespot_linux' binary.

2.1.2. On Windows

Open cmd and run the following command to clone the repository and build.

git clone https://github.com/casualsnek/onthespot
cd onthespot

If you do not have git installed you can also download the Project source zip from github, extract it and open cmd on repository root. If you want builds with ffmpeg embedded download ffmpeg binaries for your os from Here. Create a new directory named 'ffbin_win' in repository root directory. Copy three files 'ffmpeg.exe', 'ffprobe.exe', 'ffplay.exe' from downloaded archive to just created 'ffbin_win' directory then run;

build_winC1.bat
build_winC2.bat

After the command completes, you should have a 'dist' directory in repository root containing built 'onthespot_win.exe' binary.

2.1.3. On MacOS

NOTE : This only builds an app for the specific processor architecture you are on. It does not build a universal binary

Open terminal emulator and run the following command to clone the repository and build.

git clone https://github.com/casualsnek/onthespot
cd onthespot

If you want builds with ffmpeg embedded download ffmpeg binaries for your os from Here. Create a new directory named 'ffbin_mac' in repository root directory. Copy three files 'ffmpeg', 'ffprobe', 'ffplay' from the downloaded archive to the newly created 'ffbin_mac' directory then run:

./build_mac.sh

After the command completes, you should have a 'dist' directory in repository root containing the 'onthespot_mac.app' binary.

2.2. Building wheel for installing with pip

You can also build onthespot as wheel and install it as python module via pip in your system. It provides better integration with system, like using your system's Qt style and themes as well as you can use provided icon and .desktop file for better integration under linux systems.

Make sure you have set up tools installed !

Open terminal emulator and run the following command to clone the repository and build.

git clone https://github.com/casualsnek/onthespot
cd onthespot
python -m build

This will create a dist directory containing .whl file that can now be installed with pip, the application can be launched with the command onthespot_gui or python3 -m onthespot after installing !

NOTE : If you are packaging onthespot for distribution, copy src/onthespot/resources/icon.svg to either /usr/share/icons/hicolor/scalable/apps/casual_onthespot.svg or $HOME/.local/share/icons/hicolor/scalable/apps/casual_onthespot.svg, and src/onthespot/resources/org.eu.casualsnek.onthespot.desktop to either /usr/share/applications/org.eu.casualsnek.onthespot.desktop or $HOME/.local/share/applications/org.eu.casualsnek.onthespot.desktop. This allows application to be better integrated to desktop environments !


If you have ideas for improvement/features create an issue or join discord server for discussion !

3. Basic Usage

Getting started

When launching the application for the first time, you will get a warning that no spotify accounts are added. Dismiss the warning, and add your account(s) at the bottom of the configuration tab. Having multiple accounts will let you download multiple songs at a time.

Searching/Downloading via query

In the 'Search' tab, you can enter your query click search to search for songs/artists/albums/playlists. You can then download media in the resulting list by clicking on the download button. Optionally, you can bulk download by clicking on any of the buttons on the below the table. Note that Media Type other than 'Tracks' can take a little longer to parse and download. The application may appear to be frozen in this state !

Downloading by URL

Enter the url in the search field then click download. You can also enter path of text file containing URL, and it will queue all url(s) in it ! Note that Media Type other than 'Tracks' can take a little longer to parse and download. Application may appear to be frozen in this state !

Download status

The download status and progress can be viewed by navigating to the 'Progress' tab.

4. Configuration

4.1. General Configuration options

  • Max download workers : It is the number of threads to be used for media downloads. Set this to the number of accounts you added. Changing this setting requires an application restart to take effect.
  • Parsing Account SN : It is the number shown at left side of the username in the accounts table. The number is the account responsible for providing search results and parsing download url(s).
  • Download Location : The root folder where downloaded media are placed in.
  • Download delay : Time in seconds to wait before next download after a successful download.
  • Max retries : Number of times to retry a download before moving on.
  • Max search results : The number of items to show in search result for each type of media. Example: setting it to '1' shows one result for artist, album, track and playlist resulting in 4 total search results.
  • Raw media download : Downloads files (they will be .ogg) to disk without converting to set media format, it also disables metadata writing and thumbnail embedding.
  • Force premium : Use this if your premium accounts shows FREE in accounts table, this applies to all added accounts so it's not recommeded to use with a combination of free and premium accounts. Don't use if account isn't premium.
  • Enable desktop app play to download : Enabling will automatically download songs you play on spotify desktop application. (Supported: Linux/Windows)
  • Show/Hide Advanced Configuration: Enable/Disables the Advanced configuration tab.
  • Save setting: Saves/Applies the settings

4.2. Advanced Configuration

Default track names are AlbumFormatter/TrackName

  • Track name formatter: This option allows you to set the naming scheme of downloaded tracks. Variables can be used by enclosing them between {}. A few variables are available to use in the naming scheme:
    • artist : Name of artist of track
    • album : Name of album the track is in *
    • name : Name of track
    • rel_year : Release year of track
    • disc_number : Disk number in which track lies *
    • track_number : Serial Number of track in album *
    • playlist_name : Name of playlist if the track is being downloaded as part of playlist *
    • playlist_owner : Name of playlist if the track is being downloaded as part of playlist *
    • playlist_desc : Description of playlist if the track is being downloaded as part of playlist *
    • genre : Genre of song *
    • label : Name of record label
    • explicit : 'Explicit' if the song is marked explicit else it will be blank
    • trackcount : Total number of tracks on the album this track is in
    • disccount : Total number of discs on the album this track is in
    • spotid : Spotify ID
    • Example: Song: {name} of album: {album} Released in {rel_year}.

The value of variables with their description ending in * maybe empty in some cases. This can also be a path.

  • Album directory name formatter: This option allows you set the naming scheme of the directories for downloaded tracks. Variables can be used by enclosing them between {}. A few variables are available to use in the naming scheme:
    • artist : name of the main artist of the album
    • rel_year: the release year of the album *
    • album: name of the album
    • playlist_name : Name of playlist if the track is being downloaded as part of playlist *
    • playlist_owner : Name of playlist if the track is being downloaded as part of playlist *
    • playlist_desc : Description of playlist if the track is being downloaded as part of playlist *
    • genre : Genre of song *
    • label : Name of record label
    • Example: {artist}/{rel_year}/{album}.

The value of variables with their description ending in * maybe empty in some cases. This can be a path too.

  • Download chunk size: Size of chunks (bytes) used for downloading.

  • Disable bulk download notice: Enabling this will disable popup dialogs about status when using bulk downloads.

  • Recoverable downloads retry delay: Time to wait before attempting another download after failed attempt.

  • Skip bytes at the end (download end skip bytes): Sometimes the last few bytes of a track can't be downloaded, leading to a 'PD Error' which causes the downloads to fail constantly. This option sets the number of bytes to skip downloading when this happens. The value might change but the current working value is '167' bytes. If you get 'decode errors' or incomplete song downloads, try setting it to 0.

  • Force Artist/Album dir for track/playlist items: If this is disabled the tracks downloaded will be placed in the root of download directory instead of artist/album directories. Enabling this might cause slower download parsing but makes organising music easier.

  • Media Format: Format of media you want your final music download to be in. Do not include '.' in it. This setting will be ignored while using the raw media download option.

5. Issues

Decode error: If you are receiving this error, your account might have gotten restricted. Wait some time or try a different account. The application may crash frequently as there is no proper exception handling yet. You can help by opening a new issue with the error message displayed in your console window after the application misbehaves.

6. Contributing/Supporting

You can write code to include additional feature or bug fixes or make a issue regarding bugs and features or just spread the work about the application :) If you want to support financially, you can visit Here and support through open collective or BTC If you like the project, show your support by giving it a star :) !

onthespot's People

Contributors

80-am avatar agent255 avatar calvin-li-developer avatar casualsnek avatar dhjw avatar dylanrsmith avatar hasecilu avatar sravan1946 avatar tempuser13 avatar tresni avatar vadevesi avatar whoisyoges avatar yuvidx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

onthespot's Issues

Bug or a request? Handling of audiobooks

Describe the bug
Tried to use it with an audiobook I have purchased, it seems like it doesn't have a handler for Audiobooks? It looks like it handles it like a Podcast and it fails when it doesn't find any episodes. This is the error message I got.

Traceback (most recent call last):
File "worker\utility.py", line 145, in run
File "utils\spotify.py", line 354, in get_show_episodes
KeyError: 'items'

To Reproduce
Steps to reproduce the behavior:

  1. Find an audiobook and copy link?
  2. Paste link, search and download

System Information (please complete the following information):

  • OS: Windows 10
  • OnTheSpot Version: 0.5

Download Error - No such file or directory

I get errors trying to download a specific german audio series as seen below.
However, when I save the files using the formatter {artist}{album} instead of standard {artist}[{rel_year}] {album}
the downloads do work

Working on windows 11 with administrator rights and wiht the latest .exe release

[2023-01-26 21:24:05,978 :: worker\downloader.py -> 248:                 run() :: INFO] -> Processing download for track by id '35FjLFs9vqxdcuhXR9tGa8', Attempt: 2
[2023-01-26 21:24:06,292 :: worker\downloader.py -> 185:      download_track() :: ERROR] -> Download failed for track by id '35FjLFs9vqxdcuhXR9tGa8', Unexpected error: Traceback (most recent call last):
  File "worker\downloader.py", line 96, in download_track
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\Dirk\\Music\\OnTheSpot\\Robin Hood - Schlitzohr von Sherwood\\[2014] Folge 1 Die Schatzkiste (Das Original-Hörspiel zur TV-Serie)\\Robin Hood - Schlitzohr von Sherwood - Folge 1 Die Schatzkiste (Das Original-Hörspiel zur TV-Serie) - Die Entführung - Teil 1.mp3'
 !
[2023-01-26 21:24:06,308 :: worker\downloader.py -> 279:                 run() :: ERROR] -> Download process returned false: 35FjLFs9vqxdcuhXR9tGa8

Feature: Read links from playlist

There are other media downloaders, Gallery-DL and YT DLP, that can take a text document of links and use that as a download source. Since the GUI already takes in the download, it sounds like it may be possible to use that to read from a list of links.

Download failing MacOS ffprobe

Had the below issues while trying to download any given song. It seems like it can't find ffprobe or ffmpeg, despite the fact that the two unix executables are in the /onthespot directory. I'm not too sure what I'm doing wrong as everything else in the program seems to work well, but I tried to include the terminal log from launching the program. Also included a screenshot of the /onthespot directory.

[2022-11-17 14:17:11,200 :: /Users/finnellingwood/onthespot/gui/mainui.py -> 80: init() :: INFO] -> Initialising main window
[2022-11-17 14:17:11,200 :: /Users/finnellingwood/onthespot/gui/mainui.py -> 95: init() :: INFO] -> Loading configurations..
[2022-11-17 14:17:11,200 :: /Users/finnellingwood/onthespot/gui/mainui.py -> 466: __fill_configs() :: INFO] -> Config filled to UI
[2022-11-17 14:17:11,200 :: /Users/finnellingwood/onthespot/gui/mainui.py -> 107: init() :: INFO] -> Preparing session loader
[2022-11-17 14:17:11,201 :: /Users/finnellingwood/onthespot/gui/mainui.py -> 119: init() :: INFO] -> Preparing parsing queue processor
[2022-11-17 14:17:11,201 :: /Users/finnellingwood/onthespot/worker/session.py -> 17: run() :: INFO] -> Session loader has started !
[2022-11-17 14:17:11,201 :: /Users/finnellingwood/onthespot/gui/mainui.py -> 163: set_table_props() :: INFO] -> Setting table item properties
[2022-11-17 14:17:11,201 :: /Users/finnellingwood/onthespot/worker/utility.py -> 80: run() :: INFO] -> Parsing queue processor is active !
[2022-11-17 14:17:11,201 :: /Users/finnellingwood/onthespot/worker/session.py -> 23: run() :: INFO] -> Trying to create session for zvmn
[2022-11-17 14:17:11,201 :: /Users/finnellingwood/onthespot/gui/mainui.py -> 135: init() :: INFO] -> Main window init completed !
[2022-11-17 14:17:11,407 :: /Users/finnellingwood/onthespot/utils/utils.py -> 18: login_user() :: INFO] -> logging in user 'zvmn****@.'
[2022-11-17 14:17:11,407 :: /Users/finnellingwood/onthespot/utils/utils.py -> 24: login_user() :: INFO] -> Session file exists for user, attempting to use it 'zvmn
***@.'
[2022-11-17 14:17:13,216 :: /Users/finnellingwood/onthespot/utils/utils.py -> 35: login_user() :: INFO] -> Login successful for user 'zvmn
***@*.'
[2022-11-17 14:17:13,429 :: /Users/finnellingwood/onthespot/gui/mainui.py -> 381:__generate_users_table() :: INFO] -> Accounts table was populated !
[2022-11-17 14:17:13,460 :: /Users/finnellingwood/onthespot/gui/mainui.py -> 385: __rebuild_threads() :: INFO] -> Building downloader.py threads
[2022-11-17 14:17:13,460 :: /Users/finnellingwood/onthespot/gui/mainui.py -> 387: __rebuild_threads() :: WARNING] -> Session pool not empty ! Reset not implemented
[2022-11-17 14:17:13,460 :: /Users/finnellingwood/onthespot/gui/mainui.py -> 390: __rebuild_threads() :: INFO] -> Spawning 4 downloaders !
[2022-11-17 14:17:13,460 :: /Users/finnellingwood/onthespot/gui/mainui.py -> 400: __rebuild_threads() :: INFO] -> Spawning DL WORKER 1 using session_index: 0
[2022-11-17 14:17:13,461 :: /Users/finnellingwood/onthespot/gui/mainui.py -> 400: __rebuild_threads() :: INFO] -> Spawning DL WORKER 2 using session_index: 0
[2022-11-17 14:17:13,461 :: /Users/finnellingwood/onthespot/worker/downloader.py -> 242: run() :: INFO] -> Download worker DL WORKER 1 is running
[2022-11-17 14:17:13,461 :: /Users/finnellingwood/onthespot/gui/mainui.py -> 400: __rebuild_threads() :: INFO] -> Spawning DL WORKER 3 using session_index: 0
[2022-11-17 14:17:13,461 :: /Users/finnellingwood/onthespot/worker/downloader.py -> 242: run() :: INFO] -> Download worker DL WORKER 2 is running
[2022-11-17 14:17:13,461 :: /Users/finnellingwood/onthespot/worker/downloader.py -> 242: run() :: INFO] -> Download worker DL WORKER 3 is running
[2022-11-17 14:17:13,461 :: /Users/finnellingwood/onthespot/gui/mainui.py -> 400: __rebuild_threads() :: INFO] -> Spawning DL WORKER 4 using session_index: 0
[2022-11-17 14:17:13,462 :: /Users/finnellingwood/onthespot/worker/downloader.py -> 242: run() :: INFO] -> Download worker DL WORKER 4 is running
2022-11-17 14:17:14.533 Python[16211:104199] TSM AdjustCapsLockLEDForKeyTransitionHandling - _ISSetPhysicalKeyboardCapsLockLED Inhibit
[2022-11-17 14:17:15,081 :: /Users/finnellingwood/onthespot/gui/mainui.py -> 563:__get_search_results() :: INFO] -> Search clicked with value term aha
[2022-11-17 14:17:15,083 :: /Users/finnellingwood/onthespot/utils/spotify.py -> 181: search_by_term() :: INFO] -> Get search result for term 'aha', max items '10'
[2022-11-17 14:17:16,787 :: /Users/finnellingwood/onthespot/worker/utility.py -> 63: enqueue_tracks() :: INFO] -> PQP parsing Take on Me:2WfaOiMkCvy7F5fcp2zZ8L <-> track item: Take on Me:2WfaOiMkCvy7F5fcp2zZ8L
[2022-11-17 14:17:16,805 :: /Users/finnellingwood/onthespot/gui/mainui.py -> 309:__add_item_to_downloads() :: INFO] -> Adding item to download queue -> media_type:track, media_id: 2WfaOiMkCvy7F5fcp2zZ8L, extra_path:, extra_path_as_root: False, Prefix value: ''
[2022-11-17 14:17:16,805 :: /Users/finnellingwood/onthespot/worker/downloader.py -> 248: run() :: INFO] -> Processing download for track by id '2WfaOiMkCvy7F5fcp2zZ8L', Attempt: 0
[2022-11-17 14:17:21,201 :: /Users/finnellingwood/onthespot/worker/downloader.py -> 128: download_track() :: WARNING] -> Force raw is disabled for track by id '2WfaOiMkCvy7F5fcp2zZ8L', media converting and tagging will be done !
[2022-11-17 14:17:21,202 :: /Users/finnellingwood/onthespot/utils/spotify.py -> 129:convert_audio_format() :: INFO] -> Audiosegment media at '/Users/finnellingwood/Music/OnTheSpot/a-ha/[1985] Hunting High and Low/a-ha - Hunting High and Low - Take on Me.mp3'
[2022-11-17 14:17:21,231 :: /Users/finnellingwood/onthespot/worker/downloader.py -> 185: download_track() :: ERROR] -> Download failed for track by id '2WfaOiMkCvy7F5fcp2zZ8L', Unexpected error: Traceback (most recent call last):
File "/Users/finnellingwood/onthespot/worker/downloader.py", line 133, in download_track
convert_audio_format(filename, quality)
File "/Users/finnellingwood/onthespot/utils/spotify.py", line 131, in convert_audio_format
raw_audio = AudioSegment.from_file(os.path.abspath(filename), format="ogg",
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pydub/audio_segment.py", line 728, in from_file
info = mediainfo_json(orig_file, read_ahead_limit=read_ahead_limit)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pydub/utils.py", line 274, in mediainfo_json
res = Popen(command, stdin=stdin_parameter, stdout=PIPE, stderr=PIPE)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 951, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 1821, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'ffprobe'
!
[2022-11-17 14:17:21,232 :: /Users/finnellingwood/onthespot/worker/downloader.py -> 279: run() :: ERROR] -> Download process returned false: 2WfaOiMkCvy7F5fcp2zZ8L

Screen Shot 2022-11-17 at 2 13 59 PM

download failed

windows 11 -running latest version of app

[2022-10-16 09:29:36,013 :: worker\downloader.py -> 185: download_track() :: ERROR] -> Download failed for track by id '1zzxoZVylsna2BQB65Ppcb', Unexpected error: Traceback (most recent call last):
File "worker\downloader.py", line 89, in download_track
File "librespot\audio_init_.py", line 722, in load
File "librespot\audio_init_.py", line 783, in load_track
File "librespot\audio_init_.py", line 737, in load_stream
File "librespot\audio_init_.py", line 336, in load_track
File "librespot\audio_init_.py", line 277, in get_audio_key
File "librespot\audio_init_.py", line 278, in get_audio_key
RuntimeError: Failed fetching audio key! gid: 33b5773c30214657865adb553239b18f, fileId: 5acf9e5cc5c6d8bcf4f69e1bbbbd5bbb4034d6d9
!
[2022-10-16 09:29:36,014 :: worker\downloader.py -> 279: run() :: ERROR] -> Download process returned false: 1zzxoZVylsna2BQB65Ppcb

Login failed, probably invalid username or password

After working for a while, i recently reinstalled as i lost the original EXE

My login isnt working, despite my creds being 100% correct, (tested, even copied/pasted)

Tried clearing my .cache/onthespot folder, still doesnt work. Is there any other cache / temp folders i can delete, as it still remembers my old Directory so something is still there

OUTPUT:

gui\mainui.py -> 549: __add_account() :: ERROR] -> Account add failed for : ACCOUNTNAME

Thanks in advance

feature: adding file naming formatting for songs

currently in the advance settings you can add {track_number} {name}. Is it possible to make it 0{track_number} {name} ?

example:

  • current: 4 Bad Habits

  • request: 04 Bad Habits

this should also be changed for the lrc files.

Is there a thing such as real-time download speed?

Basically it downloads the song at the rate it would be streamed at in the spotify app.

I heard that downloading too much gets your account banned. While I use an alt anyways, is there an option for this in case?

Failed logging in user - invalid credentials

in the logs its says "invalid credentials", but credentials are correct.
already deleted config file to eliminate possible other cause, but it didn't fix the problem.
rm .config/casualOnTheSpot/config.json
Also tried to login with email address instead username, same error.

here the console output:

18:05:12,130 :: gui/mainui.py -> 523: __add_account() :: INFO] -> Add account clicked
18:05:12,131 :: utils/utils.py -> 18: login_user() :: INFO] -> logging in user 'tm31****@.'
18:05:12,131 :: utils/utils.py -> 24: login_user() :: INFO] -> Session file exists for user, attempting to use it 'tm31
***@.'
18:05:14,091 :: utils/utils.py -> 38: login_user() :: ERROR] -> Failed logging in user 'tm31
***@*.', invalid credentials
18:05:14,092 :: runtimedata.py -> 48: handle_exception() :: CRITICAL] -> Uncaught exception

"'Cp932' codec can't decode" occurs on Japanese OS

Add encoding='UTF-8' utility.py to resolve'cp932' codec can't decode

with open(playlist_m3u_queue[play_id]['filename'], 'w')
to
with open(playlist_m3u_queue[play_id]['filename'], 'w', encoding='UTF-8')

and

with open(playlist_m3u_queue[play_id]['filename'], 'a')
to
with open(playlist_m3u_queue[play_id]['filename'], 'a', encoding='UTF-8')

I'm not sure how to do pull requests, so I'm going to write to ISSUES
Sorry.

Thumbnail error on anthing but mp3.

When downloading with media format set to anything but mp3 i get this error:
[2022-11-11 00:26:13,213 :: worker/downloader.py -> 185: download_track() :: ERROR] -> Download failed for track by id '0CL7VjsK7XnkDqoFU6eTMD', Unexpected error: Traceback (most recent call last):
File "worker/downloader.py", line 138, in download_track
File "utils/spotify.py", line 170, in set_music_thumbnail
File "music_tag/file.py", line 603, in setitem
File "music_tag/file.py", line 503, in set
File "music_tag/vorbis.py", line 41, in set_pictures
ImportError: Please install Pillow to properly handle images !
[2022-11-11 00:26:13,213 :: worker/downloader.py -> 279: run() :: ERROR] -> Download process returned false: 0CL7VjsK7XnkDqoFU6eTMD

Pillow is installed and mp3 works fine, I'm on Arch Linux installed from AUR.

I know I shouldn't make a suggestion on an issue but it'd be cool to have a ffmpeg args/bitrate field. Thanks.

macOS Monterey ffmpeg location when building from source

When I tried building from source, I noticed when following the directions within the readme that the location for the ffmpeg binaries did not work when using the ffbin_nix directory. What did work was placing the ffmpeg binaries in onthespot/bin/ffmpeg. This allowed the program to properly locate ffmpeg to download and convert without issues.

again ... Stuck at 99%

Sorry that I have to reopen this issue ... I noticed that this was happening before and ...'fixed' ... with that latest release ... but unfortunately this is still gving the same problem at my end.
I tried that V 0.3 and did also try the manual ffmpeg. I start with admin rights but still get this below error. (reboots and restarts do not help)

_During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "spotutils.py", line 405, in run
File "spotutils.py", line 340, in download_track
PermissionError: [WinError 32] The process cannot access the file because it is being used by another process:_

Could someone help please ?

Stuck at 99% - PermissionError

Was getting this error when downloading a track.

Progress bar would be stuck 'converting' at 99%.

Not sure if this is a widespread issue, I think I found a potential fix.

Traceback (most recent call last):
  File "spotutils.py", line 394, in run
    status = self.download_track(
  File "spotutils.py", line 328, in download_track
    os.remove(filename)
PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:/Music/Song.mp3'

M3u Playlist option doesn't work

I'm on Windows 10. I have M3u playlist option enabled and after all of the songs are either done downloading or already downloaded, it just repeats:
"Playlist m3u8 checking ID #############"
"Playlist ############# Has some items left to download"
There is also no info on it in the readme so I'm not sure if there is something I am missing.

Download Failed

-> Force raw is disabled for track by id '6kXLq2u5answm56UMbHSoA', media converting and tagging will be done !
[2022-10-20 12:37:38,078 :: /Users/fiancee/onthespot/utils/spotify.py -> 129:convert_audio_format() :: INFO] -> Audiosegment media at '/Users/fiancee/Dennis Smile/[2017] Abomination EP/Dennis Smile - Abomination EP - Abomination.mp3'
/usr/local/lib/python3.10/site-packages/pydub/utils.py:198: RuntimeWarning: Couldn't find ffprobe or avprobe - defaulting to ffprobe, but may not work
warn("Couldn't find ffprobe or avprobe - defaulting to ffprobe, but may not work", RuntimeWarning)
[2022-10-20 12:37:38,095 :: /Users/fiancee/onthespot/worker/downloader.py -> 185: download_track() :: ERROR] -> Download failed for track by id '6kXLq2u5answm56UMbHSoA', Unexpected error: Traceback (most recent call last):
File "/Users/fiancee/onthespot/worker/downloader.py", line 133, in download_track
convert_audio_format(filename, quality)
File "/Users/fiancee/onthespot/utils/spotify.py", line 131, in convert_audio_format
raw_audio = AudioSegment.from_file(os.path.abspath(filename), format="ogg",
File "/usr/local/lib/python3.10/site-packages/pydub/audio_segment.py", line 728, in from_file
info = mediainfo_json(orig_file, read_ahead_limit=read_ahead_limit)
File "/usr/local/lib/python3.10/site-packages/pydub/utils.py", line 274, in mediainfo_json
res = Popen(command, stdin=stdin_parameter, stdout=PIPE, stderr=PIPE)
File "/usr/local/Cellar/[email protected]/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py", line 971, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "/usr/local/Cellar/[email protected]/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py", line 1847, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'ffprobe'
!
[2022-10-20 12:37:38,097 :: /Users/fiancee/onthespot/worker/downloader.py -> 279: run() :: ERROR] -> Download process returned false: 6kXLq2u5answm56UMbHSoA
[2022-10-20 12:37:38,097 :: /Users/fiancee/onthespot/worker/downloader.py -> 248: run() :: INFO] -> Processing download for track by id '6kXLq2u5answm56UMbHSoA', Attempt: 1
[2022-10-20 12:37:43,890 :: /Users/fiancee/onthespot/worker/downloader.py -> 128: download_track() :: WARNING] -> Force raw is disabled for track by id '6kXLq2u5answm56UMbHSoA', media converting and tagging will be done !
[2022-10-20 12:37:43,891 :: /Users/fiancee/onthespot/utils/spotify.py -> 129:convert_audio_format() :: INFO] -> Audiosegment media at '/Users/fiancee/Dennis Smile/[2017] Abomination EP/Dennis Smile - Abomination EP - Abomination.mp3'
/usr/local/lib/python3.10/site-packages/pydub/utils.py:198: RuntimeWarning: Couldn't find ffprobe or avprobe - defaulting to ffprobe, but may not work
warn("Couldn't find ffprobe or avprobe - defaulting to ffprobe, but may not work", RuntimeWarning)
[2022-10-20 12:37:43,903 :: /Users/fiancee/onthespot/worker/downloader.py -> 185: download_track() :: ERROR] -> Download failed for track by id '6kXLq2u5answm56UMbHSoA', Unexpected error: Traceback (most recent call last):
File "/Users/fiancee/onthespot/worker/downloader.py", line 133, in download_track
convert_audio_format(filename, quality)
File "/Users/fiancee/onthespot/utils/spotify.py", line 131, in convert_audio_format
raw_audio = AudioSegment.from_file(os.path.abspath(filename), format="ogg",
File "/usr/local/lib/python3.10/site-packages/pydub/audio_segment.py", line 728, in from_file
info = mediainfo_json(orig_file, read_ahead_limit=read_ahead_limit)
File "/usr/local/lib/python3.10/site-packages/pydub/utils.py", line 274, in mediainfo_json
res = Popen(command, stdin=stdin_parameter, stdout=PIPE, stderr=PIPE)
File "/usr/local/Cellar/[email protected]/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py", line 971, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "/usr/local/Cellar/[email protected]/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py", line 1847, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'ffprobe'
!
[2022-10-20 12:37:43,905 :: /Users/fiancee/onthespot/worker/downloader.py -> 279: run() :: ERROR] -> Download process returned false: 6kXLq2u5answm56UMbHSoA
[2022-10-20 12:37:43,906 :: /Users/fiancee/onthespot/worker/downloader.py -> 248: run() :: INFO] -> Processing download for track by id '6kXLq2u5answm56UMbHSoA', Attempt: 2
[2022-10-20 12:37:49,335 :: /Users/fiancee/onthespot/worker/downloader.py -> 128: download_track() :: WARNING] -> Force raw is disabled for track by id '6kXLq2u5answm56UMbHSoA', media converting and tagging will be done !
[2022-10-20 12:37:49,335 :: /Users/fiancee/onthespot/utils/spotify.py -> 129:convert_audio_format() :: INFO] -> Audiosegment media at '/Users/fiancee/Dennis Smile/[2017] Abomination EP/Dennis Smile - Abomination EP - Abomination.mp3'
/usr/local/lib/python3.10/site-packages/pydub/utils.py:198: RuntimeWarning: Couldn't find ffprobe or avprobe - defaulting to ffprobe, but may not work
warn("Couldn't find ffprobe or avprobe - defaulting to ffprobe, but may not work", RuntimeWarning)
[2022-10-20 12:37:49,348 :: /Users/fiancee/onthespot/worker/downloader.py -> 185: download_track() :: ERROR] -> Download failed for track by id '6kXLq2u5answm56UMbHSoA', Unexpected error: Traceback (most recent call last):
File "/Users/fiancee/onthespot/worker/downloader.py", line 133, in download_track
convert_audio_format(filename, quality)
File "/Users/fiancee/onthespot/utils/spotify.py", line 131, in convert_audio_format
raw_audio = AudioSegment.from_file(os.path.abspath(filename), format="ogg",
File "/usr/local/lib/python3.10/site-packages/pydub/audio_segment.py", line 728, in from_file
info = mediainfo_json(orig_file, read_ahead_limit=read_ahead_limit)
File "/usr/local/lib/python3.10/site-packages/pydub/utils.py", line 274, in mediainfo_json
res = Popen(command, stdin=stdin_parameter, stdout=PIPE, stderr=PIPE)
File "/usr/local/Cellar/[email protected]/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py", line 971, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "/usr/local/Cellar/[email protected]/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py", line 1847, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'ffprobe'
!
[2022-10-20 12:37:49,351 :: /Users/fiancee/onthespot/worker/downloader.py -> 279: run() :: ERROR] -> Download process returned false: 6kXLq2u5answm56UMbHSoA

I tried removing and adding in my acc bit to no avail

Wrong textbox height

Hi, this is how I see the search text boxes in Ubuntu 22.04 (Gnome).
Thank you.

Screenshot from 2022-12-10 22-11-46

Max download workers failed

The feature of max download workers with parsing account SN seems to be working fine.
I would not download any song if one of the parameter changes.

Feature: Tagging .lrc files in mp3s

Some audio players like Navidrome read the lrc file through an embedded tag in the mp3 file. Currently, the only way to do this is with a program that can do something like this en masse like Mp3tag.

Does not seem able to parse podcast episodes

Attempting to add a podcast episode URL will report that it has been added to the download queue, but it does not appear. Attempting to add the episode again will report that "The Episode is being parsed and will be added to download queue shortly." This does not seem to complete and the episode never appears in the Progress tab.

Blurry Album Art

The album art is blurry now when I download albums. I checked back with the previous version and the blurry art is still there sadly. I also checked maybe downloading a new album would display clear album art, but they are affected as well. Then I tried resetting everything and tried again, still blurry. I can just replace the album art, but I figured I'd post here.

Some songs fail at 99%

I'm using the latest developmentBranch build and some songs fail at 99%

[2023-05-20 01:52:09,075 :: worker.downloader.SESSION_DL_TH-810c87d7-4119-4e36-9b93-93722a94d6f8 :: worker\downloader.py -> 222: download_track() :: ERROR] -> Download failed for track by id '44UnT7KIVgEQFkUeXUp3OJ', Unexpected error: Traceback (most recent call last):
File "PIL\PngImagePlugin.py", line 1286, in _save
KeyError: 'CMYK'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "worker\downloader.py", line 172, in download_track
File "utils\spotify.py", line 203, in set_music_thumbnail
File "PIL\Image.py", line 2432, in save
File "PIL\PngImagePlugin.py", line 1289, in _save
OSError: cannot write mode CMYK as PNG
!
[2023-05-20 01:52:09,082 :: worker.downloader.SESSION_DL_TH-810c87d7-4119-4e36-9b93-93722a94d6f8 :: worker\downloader.py -> 377: run() :: ERROR] -> Download process returned false: 44UnT7KIVgEQFkUeXUp3OJ

image

Won't start

I get this error message:

Traceback (most recent call last): File "/home/computer/Downloads/onethespot/onthespot.py", line 3, in <module> from config import config File "/home/computer/Downloads/onethespot/config.py", line 61, in <module> config = Config() File "/home/computer/Downloads/onethespot/config.py", line 37, in __init__ os.makedirs(os.path.dirname(self.get("dlid_cache")), exist_ok=True) File "/usr/lib/python3.10/posixpath.py", line 152, in dirname p = os.fspath(p) TypeError: expected str, bytes or os.PathLike object, not NoneType

download error

If the song name contains ":", the download will fail.
use development branch

[2023-05-20 08:20:30,035 :: worker.downloader.SESSION_DL_TH-810c87d7-4119-4e36-9b93-93722a94d6f8 :: worker\downloader.py -> 333: run() :: INFO] -> Processing download for track by id '1fipeXkeQo8nXoWU2Rbu29', Attempt: 2/3 [2023-05-20 08:20:32,085 :: worker.downloader.SESSION_DL_TH-810c87d7-4119-4e36-9b93-93722a94d6f8 :: worker\downloader.py -> 222: download_track() :: ERROR] -> Download failed for track by id '1fipeXkeQo8nXoWU2Rbu29', Unexpected error: Traceback (most recent call last): File "worker\downloader.py", line 168, in download_track File "utils\spotify.py", line 138, in convert_audio_format OSError: [WinError 87] パラメーターが間違っています。: 'C:\\Users\\username\\Music\\OnTheSpot\\Yukari Tamura\\螺旋の果実\\15 - W:Wonder tale.mp3' -> 'C:\\Users\\username\\Music\\OnTheSpot\\Yukari Tamura\\螺旋の果実\\.~15 - W:Wonder tale.ogg' ! [2023-05-20 08:20:32,086 :: worker.downloader.SESSION_DL_TH-810c87d7-4119-4e36-9b93-93722a94d6f8 :: worker\downloader.py -> 377: run() :: ERROR] -> Download process returned false: 1fipeXkeQo8nXoWU2Rbu29

[Feature Request] Change titles of downloaded content based on data.

So rather than having it be shown by author - album - ##.song name, add a feature to be able to change what the title of the mp3 but still have song metadata in the mp3. This could just be an option in a preference menu

Ex:
Currently: The Cranberries - No Need To Argue (The Complete Sessions 1994-1995) - 04. Zombie.mp3
What I would like: Zombie.mp3

TypeError: 'NoneType' object is not subscriptable

can someone help me, in the log it said that TypeError: 'NoneType' object is not subscriptable

[2023-05-19 09:10:12,232 :: C:\Users\xxx\Downloads\Compressed\onthespot-0.4\onthespot-0.4\runtimedata.py -> 48: handle_exception() :: CRITICAL] -> Uncaught exception
Traceback (most recent call last):
File "C:\Users\xxx\Downloads\Compressed\onthespot-0.4\onthespot-0.4\worker\session.py", line 28, in run
if login[0]:
~~~~~^^^
TypeError: 'NoneType' object is not subscriptable

Incorrect download location upon changing location

Using the latest version from your discord server, on Windows 10

Manually selecting a download location uses / instead of \ for subdirectory locations, which are removed in the console leading to constant "No such file or directory" when trying to download (given you have saved your changes).
An example is choosing C:\Users\Username\Desktop\OnTheSpot being changed to C:UsersUsernameDesktopOnTheSpot.
This issue also occurs when I change the slash in "Album directory name formatter" under Advanced configuration from \ to / and persists after restarting.
image

Additionally when you click on Browse to select a location but instead cancel (or x), the download location text in the bar is removed, despite not resetting the download location. The popup selection defaults to your user folder instead whether or not a change has been made to the download location.
For some reason this fixes the above issue while saving in the same location.

Other than the issue above, I don't think it's because of my upscaling on my laptop but the location bar is very short. Could it instead use the space underneath to display a much longer path? image

Thanks for your work,
skrubbybubby
P.S. sorry if I forgot anything this is my first github issue report

Error on Windows

image

Hi, first of all awesome program, when i try to download something this pop on console

[Windows 10] Error when entering playlist URL

URL download clicked with value False
Parsing url 'False'
Uncaught exception
Traceback (most recent call last):
  File "onthespot.py", line 559, in __download_by_url
  File "utils.py", line 172, in get_url_data
  File "utils.py", line 86, in regex_input_for_urls
  File "re.py", line 200, in search
TypeError: expected string or bytes-like object

I don't know python so I can't make much sense of this.

High quality art

Is it possible to get higher quality art (album covers)? The current resolution is too low and looks blurry on most media players.

feat: add cli utility

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.

TypeError: 'NoneType' object is not subscriptable

``Hi. The program was working last night perfectly, today I try to open it and it hangs and gets stuck. I assume it's because the account is trying to create a session for, the password changed. I do not know where the information is saved so that I can remove the accounts and change the password. I tried to delete the EXE file and download it again, but that did not work as it must be saving accounts somewhere.

`[2022-11-23 07:50:30,172 :: gui\mainui.py -> 135: init() :: INFO] -> Main window init completed !

[2022-11-23 07:50:30,378 :: utils\utils.py -> 18: login_user() :: INFO] -> logging in user 'ACCC****@*.'

[2022-11-23 07:50:30,379 :: utils\utils.py -> 24: login_user() :: INFO] -> Session file exists for user, attempting to use it 'MORe****@*.'

[2022-11-23 07:50:32,317 :: utils\utils.py -> 38: login_user() :: ERROR] -> Failed logging in user 'MORe****@*.', invalid credentials

[2022-11-23 07:50:32,318 :: runtimedata.py -> 48: handle_exception() :: CRITICAL] -> Uncaught exception
Traceback (most recent call last):

File "worker\session.py", line 28, in run

TypeError: 'NoneType' object is not subscriptable`

EDIT1: After more diging, I found the directory for the saved accounts, "C:\Users\USER_NAME_HERE.cache\casualOnTheSpot\sessions" and deleted the bad account .json file. All working again. I would like to still leave this here in case an update to fix this without having to go into the directory and manually delete the file.

Playlist creation error

Playlist creation fails if the playlist name contains "/".
https://open.spotify.com/playlist/2KC9BMH2fMqKbGcHV2lwwk

[2023-05-21 23:48:01,083 :: worker.utility :: worker\utility.py -> 26: run() :: INFO] -> Playlist m3u8 checking ID 2KC9BMH2fMqKbGcHV2lwwk [2023-05-21 23:48:01,083 :: worker.utility :: worker\utility.py -> 31: run() :: INFO] -> Playlist 2KC9BMH2fMqKbGcHV2lwwk has all items ready, making m3u8 playlist at: {play_queue[play_id]["filename"]}! [2023-05-21 23:48:01,084 :: runtimedata :: runtimedata.py -> 51: handle_exception() :: CRITICAL] -> Uncaught exception Traceback (most recent call last): File "worker\utility.py", line 35, in run FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\username\\Music\\OnTheSpot\\!Playlist\\2007年-2023年 VOCALOID 伝説入り・神話入り楽曲 \\ 100万回再生超え ボカロ.m3u8'

Use latest development branch

Login problem on reopening

When closing the program and reopening it, it doesn't login again, it shows an "unexpected error occured".
It is not such a problem, since manually login in again works as expected.

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.