mirror of
				https://github.com/THIS-IS-NOT-A-BACKUP/zspotify.git
				synced 2025-11-03 21:10:34 +00:00 
			
		
		
		
	Merge remote-tracking branch 'upstream/main'
This commit is contained in:
		
						commit
						2703158594
					
				
							
								
								
									
										31
									
								
								.github/workflows/pypi-publish.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										31
									
								
								.github/workflows/pypi-publish.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@ -0,0 +1,31 @@
 | 
				
			|||||||
 | 
					# This workflow will upload a Python Package using Twine when a release is created
 | 
				
			||||||
 | 
					# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					name: PyPi Upload
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					on:
 | 
				
			||||||
 | 
					  release:
 | 
				
			||||||
 | 
					    types: [created]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					jobs:
 | 
				
			||||||
 | 
					  deploy:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    runs-on: ubuntu-latest
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    steps:
 | 
				
			||||||
 | 
					    - uses: actions/checkout@v2
 | 
				
			||||||
 | 
					    - name: Set up Python
 | 
				
			||||||
 | 
					      uses: actions/setup-python@v2
 | 
				
			||||||
 | 
					      with:
 | 
				
			||||||
 | 
					        python-version: '3.x'
 | 
				
			||||||
 | 
					    - name: Install dependencies
 | 
				
			||||||
 | 
					      run: |
 | 
				
			||||||
 | 
					        python -m pip install --upgrade pip
 | 
				
			||||||
 | 
					        pip install setuptools wheel twine
 | 
				
			||||||
 | 
					    - name: Build and publish
 | 
				
			||||||
 | 
					      env:
 | 
				
			||||||
 | 
					        TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
 | 
				
			||||||
 | 
					        TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
 | 
				
			||||||
 | 
					      run: |
 | 
				
			||||||
 | 
					        python setup.py sdist bdist_wheel
 | 
				
			||||||
 | 
					        twine upload dist/*
 | 
				
			||||||
							
								
								
									
										31
									
								
								setup.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										31
									
								
								setup.py
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,31 @@
 | 
				
			|||||||
 | 
					import pathlib
 | 
				
			||||||
 | 
					from setuptools import setup
 | 
				
			||||||
 | 
					import setuptools
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# The directory containing this file
 | 
				
			||||||
 | 
					HERE = pathlib.Path(__file__).parent
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# The text of the README file
 | 
				
			||||||
 | 
					README = (HERE / "README.md").read_text()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# This call to setup() does all the work
 | 
				
			||||||
 | 
					setup(
 | 
				
			||||||
 | 
					    name="zspotify",
 | 
				
			||||||
 | 
					    version="0.5.3",
 | 
				
			||||||
 | 
					    description="A spotify downloader.",
 | 
				
			||||||
 | 
					    long_description=README,
 | 
				
			||||||
 | 
					    long_description_content_type="text/markdown",
 | 
				
			||||||
 | 
					    url="https://github.com/Footsiefat/zspotify.git",
 | 
				
			||||||
 | 
					    author="logykk",
 | 
				
			||||||
 | 
					    author_email="logyx1@protonmail.com",
 | 
				
			||||||
 | 
					    license="GPLv3",
 | 
				
			||||||
 | 
					    classifiers=[
 | 
				
			||||||
 | 
					        "License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
 | 
				
			||||||
 | 
					        "Programming Language :: Python :: 3.9",
 | 
				
			||||||
 | 
					    ],
 | 
				
			||||||
 | 
					    packages=['zspotify'],
 | 
				
			||||||
 | 
					    install_requires=['ffmpy', 'music_tag', 'Pillow', 'protobuf', 'tabulate', 'tqdm', 'git+https://github.com/kokarare1212/librespot-python'],
 | 
				
			||||||
 | 
					    include_package_data=True,
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
@ -82,11 +82,14 @@ def download_from_urls(urls: list[str]) -> bool:
 | 
				
			|||||||
            download = True
 | 
					            download = True
 | 
				
			||||||
            playlist_songs = get_playlist_songs(playlist_id)
 | 
					            playlist_songs = get_playlist_songs(playlist_id)
 | 
				
			||||||
            name, _ = get_playlist_info(playlist_id)
 | 
					            name, _ = get_playlist_info(playlist_id)
 | 
				
			||||||
 | 
					            enum = 1
 | 
				
			||||||
 | 
					            char_num = len(str(len(playlist_songs)))
 | 
				
			||||||
            for song in playlist_songs:
 | 
					            for song in playlist_songs:
 | 
				
			||||||
                if not song[TRACK][NAME]:
 | 
					                if not song[TRACK][NAME]:
 | 
				
			||||||
                    Printer.print(PrintChannel.SKIPS, '###   SKIPPING:  SONG DOES NOT EXIST ON SPOTIFY ANYMORE   ###' + "\n")
 | 
					                    Printer.print(PrintChannel.SKIPS, '###   SKIPPING:  SONG DOES NOT EXIST ON SPOTIFY ANYMORE   ###' + "\n")
 | 
				
			||||||
                else:
 | 
					                else:
 | 
				
			||||||
                    download_track('playlist', song[TRACK][ID], extra_keys={'playlist': name})
 | 
					                    download_track('playlist', song[TRACK][ID], extra_keys={'playlist': name, 'playlist_num': str(enum).zfill(char_num)})
 | 
				
			||||||
 | 
					                    enum += 1
 | 
				
			||||||
        elif episode_id is not None:
 | 
					        elif episode_id is not None:
 | 
				
			||||||
            download = True
 | 
					            download = True
 | 
				
			||||||
            download_episode(episode_id)
 | 
					            download_episode(episode_id)
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user