Skip to content

Commit

Permalink
Add apple music support and emit soundcloud progress
Browse files Browse the repository at this point in the history
  • Loading branch information
justin025 committed Dec 16, 2024
1 parent 5cab0f9 commit 32fde41
Show file tree
Hide file tree
Showing 23 changed files with 765 additions and 119 deletions.
2 changes: 1 addition & 1 deletion distros/arch/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pkgdesc="Qt based music downloader written in python"
arch=('any')
url="https://github.com/justin025/onthespot"
license=('GPLv2')
depends=('ffmpeg' 'python-requests' 'python_urllib3' 'python-musictag' 'python-mutagen' 'python-pyqt6' 'python-pillow' 'python-librespot' 'yt-dlp' 'python-flask')
depends=('ffmpeg' 'python-requests' 'python_urllib3' 'python-musictag' 'python-mutagen' 'python-pyqt6' 'python-pillow' 'python-librespot' 'yt-dlp' 'python-flask' 'python-m3u8' 'python-pywidevine')
conflicts=('onthespot')
provides=('onthespot')
makedepends=('python-build' 'python-installer' 'python-setuptools' 'python-wheel')
Expand Down
1 change: 1 addition & 0 deletions distros/gentoo/dev-python/m3u8/Manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DIST m3u8-6.0.0.tar.gz 49590 BLAKE2B ffc9dd4748d4bafb690e3b8ddf3846de5044e72e98a36d53eb140c446ade128e73c0d8407f129793becb346c14ee95bc4deb7892b3f25e519216f1fa421ca839 SHA512 83f2f77772a957671a82fa482e7bc3e95a043c077e9ba2c5372c845c4fbbd2095d5eb4069ce5ca89c968cd4d6024fdee1ee87aa43a7a82bf392439275d45e137
25 changes: 25 additions & 0 deletions distros/gentoo/dev-python/m3u8/m3u8-6.0.0.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

PYTHON_COMPAT=( python3_{10..13} pypy3 )
DISTUTILS_USE_PEP517=setuptools

inherit distutils-r1

DESCRIPTION="Python m3u8 Parser for HTTP Live Streaming (HLS) Transmissions"
HOMEPAGE="
https://github.com/globocom/m3u8/
https://pypi.org/project/m3u8/
"
SRC_URI="
https://github.com/globocom/m3u8/archive/refs/tags/${PV}.tar.gz
-> ${P}.tar.gz
"

LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64"

distutils_enable_tests pytest
12 changes: 12 additions & 0 deletions distros/gentoo/dev-python/m3u8/metadata.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>[email protected]</email>
<name>Justin Donofrio</name>
</maintainer>
<upstream>
<remote-id type="github">globocom/m3u8</remote-id>
<remote-id type="pypi">m3u8</remote-id>
</upstream>
</pkgmetadata>
1 change: 1 addition & 0 deletions distros/gentoo/dev-python/pywidevine/Manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DIST pywidevine-1.8.0.tar.gz 110922 BLAKE2B 2cd1a96776b5ed275e4e6921e2e655c0a0c1f34de5d51a5244689b4db4085f97f04a7d54baed125df8dcde5b910797dbc9da822bec9a19903ec86e9d37e20c94 SHA512 b6cdb294c289ad7e765ac9afc5bbd2f612183efe5971065cab503fafbbaf53ba393425b1572e2cd406403d0361de02dc610887f2317255c72164300ac544f326
12 changes: 12 additions & 0 deletions distros/gentoo/dev-python/pywidevine/metadata.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>[email protected]</email>
<name>Justin Donofrio</name>
</maintainer>
<upstream>
<remote-id type="github">devine-dl/pywidevine</remote-id>
<remote-id type="pypi">pywidevine</remote-id>
</upstream>
</pkgmetadata>
25 changes: 25 additions & 0 deletions distros/gentoo/dev-python/pywidevine/pywidevine-1.8.0.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

PYTHON_COMPAT=( python3_{10..13} pypy3 )
DISTUTILS_USE_PEP517=poetry

inherit distutils-r1

DESCRIPTION="Python implementation of Google's Widevine DRM CDM"
HOMEPAGE="
https://github.com/devine-dl/pywidevine/
https://pypi.org/project/pywidevine/
"
SRC_URI="
https://github.com/devine-dl/pywidevine/archive/refs/tags/v${PV}.tar.gz
-> ${P}.tar.gz
"

LICENSE="GPL-3"
SLOT="0"
KEYWORDS="~amd64"

distutils_enable_tests pytest
2 changes: 2 additions & 0 deletions distros/gentoo/media-sound/onthespot/onthespot-1.0.4.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@ BDEPEND="
RDEPEND="
dev-python/flask
dev-python/librespot
dev-python/m3u8
dev-python/music-tag
dev-python/pillow
dev-python/pyqt6[network,widgets]
dev-python/pywidevine
dev-python/requests
dev-python/urllib3
media-libs/mutagen
Expand Down
12 changes: 7 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
Flask
flask
librespot
m3u8
music-tag
mutagen
Pillow
PyQt6
PyQt6_sip
Requests
pillow
pyqt6
pyqt6_sip
pywidevine
requests
urllib3
yt-dlp
18 changes: 17 additions & 1 deletion src/onthespot/accounts.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from PyQt6.QtCore import QThread, pyqtSignal
from .api.apple_music import apple_music_login_user, apple_music_get_token
from .api.bandcamp import bandcamp_login_user
from .api.deezer import deezer_login_user, deezer_get_token
from .api.soundcloud import soundcloud_login_user, soundcloud_get_token
Expand Down Expand Up @@ -27,7 +28,22 @@ def run(self):
if not account['active']:
continue

if service == 'bandcamp':

if service == 'apple_music':
if self.gui is True:
self.progress.emit(self.tr('Attempting to create session for\n{0}...').format(account['login']['pltvcid']), True)

valid_login = apple_music_login_user(account)
if valid_login:
if self.gui is True:
self.progress.emit(self.tr('Session created for\n{0}!').format(account['login']['pltvcid']), True)
continue
else:
if self.gui is True:
self.progress.emit(self.tr('Login failed for \n{0}!').format(account['login']['pltvcid']), True)
continue

elif service == 'bandcamp':
bandcamp_login_user(account)
continue

Expand Down
Loading

0 comments on commit 32fde41

Please sign in to comment.