Skip to content
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

For pypi #2

Merged
merged 22 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .assets/pic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,9 @@ a.py
__pycache__
*/__pycache__
*.mp4
*.mov
*.mov
.tve
.testvenv
token
*.egg-info
dist
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
recursive-include data *
recursive-include .assets *
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# How to install

* `git clone https://github.com/Code-Theft-Auto/yami.git`
* `git clone https://github.com/DevER-M/yami.git`

* `cd yami`

Expand All @@ -13,4 +13,4 @@
* `python run.py`

## Screenshot
![pic](pic/pic.png)
![pic](https://raw.githubusercontent.com/DevER-M/yami/refs/heads/for-pypi/.assets/pic.png)
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
Empty file removed mus/__init__.py
Empty file.
49 changes: 49 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[project]
name = "yami-music-player"
version = "1.0.0"
description="An open-source music player with simple UI"
readme = "README.md"
requires-python = ">=3.8"
license = {file = "LICENSE"}
keywords = [
"tkinter",
"youtube-music-player",
"spotdl",
"online-music-player",
"customtkinter",
"youtube-dl"]
authors = [{name = "Mithun", email="mg.a54@proton.me"}]
maintainers = [{name = "Mithun", email="mg.a54@proton.me"}]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: End Users/Desktop",
"Operating System :: OS Independent",
"License :: OSI Approved :: GNU General Public License (GPL)",
"Programming Language :: Python :: 3"
]
dynamic = ["dependencies"]

[project.urls]
Documentation = "https://github.com/dever-m/yami/blob/main/README.md"
"Bug Tracker" = "https://github.com/dever-m/yami/issues"
"Source code" = "https://github.com/dever-m/yami"

[tool.setuptools.dynamic]
dependencies = {file = ["requirements.txt"]}

[tool.setuptools]
include-package-data = true

[tool.setuptools.packages.find]
where=["."]

[tool.setuptools.package-data]
yami = ["./data/*"]

[project.scripts]
yami = "yami.main:entry"

52 changes: 3 additions & 49 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,51 +1,5 @@
annotated-types==0.7.0
anyio==3.7.1
beautifulsoup4==4.12.3
Brotli==1.1.0
certifi==2024.8.30
charset-normalizer==3.3.2
click==8.1.7
customtkinter @ git+https://github.com/ElSaico/CustomTkinter.git@c056dddbbbac5d1daf74595b6ce02c7b17f32306
dacite==1.8.1
darkdetect==0.8.0
Deprecated==1.2.14
fastapi==0.103.2
h11==0.14.0
idna==3.10
jaconv==0.4.0
markdown-it-py==3.0.0
mdurl==0.1.2
customtkinter-fix-locale-scaling==5.2.2
mutagen==1.47.0
packaging==24.1
pillow==10.4.0
platformdirs==4.3.6
pycryptodomex==3.20.0
pydantic==2.9.2
pydantic_core==2.23.4
pygame==2.6.0
Pygments==2.18.0
pykakasi==2.3.0
python-dateutil==2.9.0.post0
python-slugify==8.0.4
pytube==15.0.0
rapidfuzz==3.9.7
redis==5.0.8
requests==2.32.3
rich==13.8.1
six==1.16.0
sniffio==1.3.1
soundcloud-v2==1.6.0
soupsieve==2.6
Pillow==11.0.0
pygame==2.6.1
spotdl==4.2.8
spotipy==2.24.0
starlette==0.27.0
syncedlyrics==1.0.1
text-unidecode==1.3
typing_extensions==4.12.2
Unidecode==1.3.8
urllib3==2.2.3
uvicorn==0.23.2
websockets==13.0.1
wrapt==1.16.0
yt-dlp==2024.8.6
ytmusicapi==1.8.1
10 changes: 0 additions & 10 deletions run.py

This file was deleted.

3 changes: 3 additions & 0 deletions yami/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from .music import MusicPlayer

__all__ = ["MusicPlayer"]
File renamed without changes.
File renamed without changes.
11 changes: 11 additions & 0 deletions yami/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
"""Console entry point"""

import logging
from yami.music import MusicPlayer

"""add sys args and logs"""

logging.getLogger().setLevel(logging.INFO)
def entry():
app = MusicPlayer()
app.mainloop()
14 changes: 7 additions & 7 deletions mus/music.py → yami/music.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from .util import GEOMETRY, TITLE, PlayerState, EVENT_INTERVAL


ctk.set_default_color_theme("theme.json")
ctk.set_default_color_theme("data/theme.json")
ctk.set_appearance_mode("dark")


Expand Down Expand Up @@ -240,12 +240,12 @@ def check_for_events(self):
self.play_next_song()

def setup_icons(self):
self.play_icon = ctk.CTkImage(Image.open("pic/play_arrow.png"))
self.pause_icon = ctk.CTkImage(Image.open("pic/pause.png"))
self.prev_icon = ctk.CTkImage(Image.open("pic/skip_prev.png"))
self.next_icon = ctk.CTkImage(Image.open("pic/skip_next.png"))
self.folder_icon = ctk.CTkImage(Image.open("pic/folder.png"))
self.music_icon = ctk.CTkImage(Image.open("pic/music.png"))
self.play_icon = ctk.CTkImage(Image.open("data/play_arrow.png"))
self.pause_icon = ctk.CTkImage(Image.open("data/pause.png"))
self.prev_icon = ctk.CTkImage(Image.open("data/skip_prev.png"))
self.next_icon = ctk.CTkImage(Image.open("data/skip_next.png"))
self.folder_icon = ctk.CTkImage(Image.open("data/folder.png"))
self.music_icon = ctk.CTkImage(Image.open("data/music.png"))
logging.info("icons setup")

def setup_bindings(self):
Expand Down
2 changes: 1 addition & 1 deletion mus/playlist.py → yami/playlist.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def __init__(self, parent):
borderwidth=10,
activestyle="none",
width=34,
height=18,
height=16,
relief="flat",
bg="#141414",
fg="#e0e0e0",
Expand Down
File renamed without changes.
12 changes: 5 additions & 7 deletions mus/topbar.py → yami/topbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ def choose_folder(self, _event=None):
self.parent.playlist_frame.song_list.insert(
"end", f"• {Path(file).stem}"
)
os.chdir(self.parent.current_folder)

def prompt_download(self):
if not self.parent.current_folder:
Expand All @@ -91,7 +92,6 @@ def prompt_download(self):
"Download Music", "Enter the name of the song:"
)
if song_url:
self.music_downloader.configure(state="disabled")
self.parent.loop.create_task(self.download_song(song_url))

async def download_song(self, song_url):
Expand All @@ -107,7 +107,7 @@ async def download_song(self, song_url):
)
await asyncio.sleep(0) # STOP FROM FREEZING
logging.info("saving file")
downloaded_song_path = os.path.join(
self.downloaded_song_path = os.path.join(
self.parent.current_folder,
spotdl.utils.formatter.create_file_name(
song=song,
Expand All @@ -119,13 +119,11 @@ async def download_song(self, song_url):
],
),
)
logging.info("saved at %s", downloaded_song_path)
logging.info("saved at %s", self.downloaded_song_path)
except Exception as e:
logging.error(e)
finally:
self.music_downloader.configure(state="normal")

self.parent.playlist.append(downloaded_song_path)
self.parent.playlist.append(self.downloaded_song_path)
self.parent.playlist_frame.song_list.insert(
"end", f"• {Path(downloaded_song_path).stem}"
"end", f"• {Path(self.downloaded_song_path).stem}"
)
File renamed without changes.
Loading