🎉 v0.0.1 initial commit 🎉

This commit is contained in:
ZiCode0
2025-08-24 16:12:33 +12:00
commit 2bdd869811
10 changed files with 944 additions and 0 deletions
+186
View File
@@ -0,0 +1,186 @@
# Created by .ignore support plugin (hsz.mobi)
### Python template
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
env/
.venv/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit tests / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
target/
# IPython Notebook
.ipynb_checkpoints
# pyenv
.python-version
# celery beat schedule file
celerybeat-schedule
# dotenv
.env
# virtualenv
venv/
ENV/
# Spyder project settings
.spyderproject
# Rope project settings
.ropeproject
### VirtualEnv template
# Virtualenv
# http://iamzed.com/2009/05/07/a-primer-on-virtualenv/
[Bb]in
[Ii]nclude
[Ll]ib
[Ll]ib64
[Ll]ocal
[Ss]cripts
pyvenv.cfg
.venv
pip-selfcheck.json
### JetBrains template
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf
# AWS User-specific
.idea/**/aws.xml
# Generated files
.idea/**/contentModel.xml
# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml
# Gradle
.idea/**/gradle.xml
.idea/**/libraries
# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/artifacts
# .idea/compiler.xml
# .idea/jarRepositories.xml
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr
# CMake
cmake-build-*/
# Mongo Explorer plugin
.idea/**/mongoSettings.xml
# File-based project format
*.iws
# IntelliJ
out/
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Cursive Clojure plugin
.idea/replstate.xml
# SonarLint plugin
.idea/sonarlint/
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
# Editor-based Rest Client
.idea/httpRequests
# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser
# idea folder, uncomment if you don't need it
.idea
+8
View File
@@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml
+10
View File
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.venv" />
</content>
<orderEntry type="jdk" jdkName="uv (dify_zcd_tool_mob_ya_music_control)" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
+292
View File
@@ -0,0 +1,292 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="PyPackageRequirementsInspection" enabled="true" level="WARNING" enabled_by_default="true">
<option name="ignoredPackages">
<value>
<list size="278">
<item index="0" class="java.lang.String" itemvalue="application-utility" />
<item index="1" class="java.lang.String" itemvalue="greenlet" />
<item index="2" class="java.lang.String" itemvalue="pycairo" />
<item index="3" class="java.lang.String" itemvalue="python-slugify" />
<item index="4" class="java.lang.String" itemvalue="markdown-it-py" />
<item index="5" class="java.lang.String" itemvalue="python-magic" />
<item index="6" class="java.lang.String" itemvalue="roman-numerals-py" />
<item index="7" class="java.lang.String" itemvalue="mccabe" />
<item index="8" class="java.lang.String" itemvalue="pycryptodomex" />
<item index="9" class="java.lang.String" itemvalue="starlette" />
<item index="10" class="java.lang.String" itemvalue="lxml" />
<item index="11" class="java.lang.String" itemvalue="huggingface_hub" />
<item index="12" class="java.lang.String" itemvalue="python-xlib" />
<item index="13" class="java.lang.String" itemvalue="Werkzeug" />
<item index="14" class="java.lang.String" itemvalue="gi-docgen" />
<item index="15" class="java.lang.String" itemvalue="asgiref" />
<item index="16" class="java.lang.String" itemvalue="click" />
<item index="17" class="java.lang.String" itemvalue="jaraco.context" />
<item index="18" class="java.lang.String" itemvalue="contourpy" />
<item index="19" class="java.lang.String" itemvalue="pefile" />
<item index="20" class="java.lang.String" itemvalue="pyxdg" />
<item index="21" class="java.lang.String" itemvalue="boto3" />
<item index="22" class="java.lang.String" itemvalue="installer" />
<item index="23" class="java.lang.String" itemvalue="pydantic_core" />
<item index="24" class="java.lang.String" itemvalue="execnet" />
<item index="25" class="java.lang.String" itemvalue="matplotlib" />
<item index="26" class="java.lang.String" itemvalue="PySide6" />
<item index="27" class="java.lang.String" itemvalue="Mako" />
<item index="28" class="java.lang.String" itemvalue="autocommand" />
<item index="29" class="java.lang.String" itemvalue="pycurl" />
<item index="30" class="java.lang.String" itemvalue="pluggy" />
<item index="31" class="java.lang.String" itemvalue="cffi" />
<item index="32" class="java.lang.String" itemvalue="numpy" />
<item index="33" class="java.lang.String" itemvalue="auditwheel" />
<item index="34" class="java.lang.String" itemvalue="cbor2" />
<item index="35" class="java.lang.String" itemvalue="mypy_extensions" />
<item index="36" class="java.lang.String" itemvalue="alabaster" />
<item index="37" class="java.lang.String" itemvalue="pyOpenSSL" />
<item index="38" class="java.lang.String" itemvalue="mdurl" />
<item index="39" class="java.lang.String" itemvalue="pysmbc" />
<item index="40" class="java.lang.String" itemvalue="userpath" />
<item index="41" class="java.lang.String" itemvalue="pytest-timeout" />
<item index="42" class="java.lang.String" itemvalue="pyee" />
<item index="43" class="java.lang.String" itemvalue="types-pyOpenSSL" />
<item index="44" class="java.lang.String" itemvalue="websockets" />
<item index="45" class="java.lang.String" itemvalue="annotated-types" />
<item index="46" class="java.lang.String" itemvalue="importlib_metadata" />
<item index="47" class="java.lang.String" itemvalue="jaraco.classes" />
<item index="48" class="java.lang.String" itemvalue="black" />
<item index="49" class="java.lang.String" itemvalue="imagesize" />
<item index="50" class="java.lang.String" itemvalue="pyserial" />
<item index="51" class="java.lang.String" itemvalue="pytest-asyncio" />
<item index="52" class="java.lang.String" itemvalue="PyQtChart" />
<item index="53" class="java.lang.String" itemvalue="pytest-runner" />
<item index="54" class="java.lang.String" itemvalue="autobahn" />
<item index="55" class="java.lang.String" itemvalue="types-cryptography" />
<item index="56" class="java.lang.String" itemvalue="babel" />
<item index="57" class="java.lang.String" itemvalue="multidict" />
<item index="58" class="java.lang.String" itemvalue="pytz" />
<item index="59" class="java.lang.String" itemvalue="unicorn" />
<item index="60" class="java.lang.String" itemvalue="dataset" />
<item index="61" class="java.lang.String" itemvalue="keyring" />
<item index="62" class="java.lang.String" itemvalue="normality" />
<item index="63" class="java.lang.String" itemvalue="requests-toolbelt" />
<item index="64" class="java.lang.String" itemvalue="npyscreen" />
<item index="65" class="java.lang.String" itemvalue="protobuf" />
<item index="66" class="java.lang.String" itemvalue="python-steamgriddb" />
<item index="67" class="java.lang.String" itemvalue="kismon" />
<item index="68" class="java.lang.String" itemvalue="inputs" />
<item index="69" class="java.lang.String" itemvalue="mypy" />
<item index="70" class="java.lang.String" itemvalue="pathvalidate" />
<item index="71" class="java.lang.String" itemvalue="pycups" />
<item index="72" class="java.lang.String" itemvalue="python-dotenv" />
<item index="73" class="java.lang.String" itemvalue="h11" />
<item index="74" class="java.lang.String" itemvalue="fsspec" />
<item index="75" class="java.lang.String" itemvalue="tinydb" />
<item index="76" class="java.lang.String" itemvalue="docopt" />
<item index="77" class="java.lang.String" itemvalue="filelock" />
<item index="78" class="java.lang.String" itemvalue="lit" />
<item index="79" class="java.lang.String" itemvalue="entrypoints" />
<item index="80" class="java.lang.String" itemvalue="pyparsing" />
<item index="81" class="java.lang.String" itemvalue="uvloop" />
<item index="82" class="java.lang.String" itemvalue="QScintilla" />
<item index="83" class="java.lang.String" itemvalue="hyperlink" />
<item index="84" class="java.lang.String" itemvalue="service-identity" />
<item index="85" class="java.lang.String" itemvalue="uv" />
<item index="86" class="java.lang.String" itemvalue="argcomplete" />
<item index="87" class="java.lang.String" itemvalue="iniconfig" />
<item index="88" class="java.lang.String" itemvalue="keyutils" />
<item index="89" class="java.lang.String" itemvalue="aiohappyeyeballs" />
<item index="90" class="java.lang.String" itemvalue="cryptography" />
<item index="91" class="java.lang.String" itemvalue="orjson" />
<item index="92" class="java.lang.String" itemvalue="gps" />
<item index="93" class="java.lang.String" itemvalue="asciimatics" />
<item index="94" class="java.lang.String" itemvalue="distlib" />
<item index="95" class="java.lang.String" itemvalue="speedtest-cli" />
<item index="96" class="java.lang.String" itemvalue="cfgv" />
<item index="97" class="java.lang.String" itemvalue="distro" />
<item index="98" class="java.lang.String" itemvalue="pathspec" />
<item index="99" class="java.lang.String" itemvalue="flaky" />
<item index="100" class="java.lang.String" itemvalue="htmlentities" />
<item index="101" class="java.lang.String" itemvalue="wcwidth" />
<item index="102" class="java.lang.String" itemvalue="Jinja2" />
<item index="103" class="java.lang.String" itemvalue="cupshelpers" />
<item index="104" class="java.lang.String" itemvalue="tomlkit" />
<item index="105" class="java.lang.String" itemvalue="meson" />
<item index="106" class="java.lang.String" itemvalue="pytest-cov" />
<item index="107" class="java.lang.String" itemvalue="arandr" />
<item index="108" class="java.lang.String" itemvalue="fissix" />
<item index="109" class="java.lang.String" itemvalue="txaio" />
<item index="110" class="java.lang.String" itemvalue="frida-tools" />
<item index="111" class="java.lang.String" itemvalue="coverage" />
<item index="112" class="java.lang.String" itemvalue="pydantic-settings" />
<item index="113" class="java.lang.String" itemvalue="notify2" />
<item index="114" class="java.lang.String" itemvalue="pydantic-extra-types" />
<item index="115" class="java.lang.String" itemvalue="identify" />
<item index="116" class="java.lang.String" itemvalue="prompt_toolkit" />
<item index="117" class="java.lang.String" itemvalue="pyflakes" />
<item index="118" class="java.lang.String" itemvalue="asn1crypto" />
<item index="119" class="java.lang.String" itemvalue="ProtonUp-Qt" />
<item index="120" class="java.lang.String" itemvalue="pyproject_hooks" />
<item index="121" class="java.lang.String" itemvalue="text-unidecode" />
<item index="122" class="java.lang.String" itemvalue="twine" />
<item index="123" class="java.lang.String" itemvalue="rich" />
<item index="124" class="java.lang.String" itemvalue="setuptools-scm" />
<item index="125" class="java.lang.String" itemvalue="packaging" />
<item index="126" class="java.lang.String" itemvalue="chardet" />
<item index="127" class="java.lang.String" itemvalue="pyzstd" />
<item index="128" class="java.lang.String" itemvalue="s3transfer" />
<item index="129" class="java.lang.String" itemvalue="soundfile" />
<item index="130" class="java.lang.String" itemvalue="sphinxcontrib-jsmath" />
<item index="131" class="java.lang.String" itemvalue="aiohttp" />
<item index="132" class="java.lang.String" itemvalue="gps3" />
<item index="133" class="java.lang.String" itemvalue="event-bus" />
<item index="134" class="java.lang.String" itemvalue="KismetCaptureRtladsb" />
<item index="135" class="java.lang.String" itemvalue="PyYAML" />
<item index="136" class="java.lang.String" itemvalue="KismetCaptureRtl433" />
<item index="137" class="java.lang.String" itemvalue="pyfluidsynth" />
<item index="138" class="java.lang.String" itemvalue="shiboken6-generator" />
<item index="139" class="java.lang.String" itemvalue="libtmux" />
<item index="140" class="java.lang.String" itemvalue="pycparser" />
<item index="141" class="java.lang.String" itemvalue="rfc3986" />
<item index="142" class="java.lang.String" itemvalue="PyGObject" />
<item index="143" class="java.lang.String" itemvalue="apksigtool" />
<item index="144" class="java.lang.String" itemvalue="Pygments" />
<item index="145" class="java.lang.String" itemvalue="PyQt5" />
<item index="146" class="java.lang.String" itemvalue="sphinxcontrib-qthelp" />
<item index="147" class="java.lang.String" itemvalue="typogrify" />
<item index="148" class="java.lang.String" itemvalue="docutils" />
<item index="149" class="java.lang.String" itemvalue="id" />
<item index="150" class="java.lang.String" itemvalue="uvicorn" />
<item index="151" class="java.lang.String" itemvalue="pyinotify" />
<item index="152" class="java.lang.String" itemvalue="pydantic" />
<item index="153" class="java.lang.String" itemvalue="pyperclip" />
<item index="154" class="java.lang.String" itemvalue="hexdump" />
<item index="155" class="java.lang.String" itemvalue="icoextract" />
<item index="156" class="java.lang.String" itemvalue="capstone" />
<item index="157" class="java.lang.String" itemvalue="reportlab" />
<item index="158" class="java.lang.String" itemvalue="QDarkStyle" />
<item index="159" class="java.lang.String" itemvalue="SecretStorage" />
<item index="160" class="java.lang.String" itemvalue="PyICU" />
<item index="161" class="java.lang.String" itemvalue="jnitrace" />
<item index="162" class="java.lang.String" itemvalue="attrs" />
<item index="163" class="java.lang.String" itemvalue="psutil" />
<item index="164" class="java.lang.String" itemvalue="simplejson" />
<item index="165" class="java.lang.String" itemvalue="objgraph" />
<item index="166" class="java.lang.String" itemvalue="tldr" />
<item index="167" class="java.lang.String" itemvalue="helpdev" />
<item index="168" class="java.lang.String" itemvalue="KismetCaptureRtlamr" />
<item index="169" class="java.lang.String" itemvalue="platformdirs" />
<item index="170" class="java.lang.String" itemvalue="propcache" />
<item index="171" class="java.lang.String" itemvalue="opensnitch-ui" />
<item index="172" class="java.lang.String" itemvalue="alembic" />
<item index="173" class="java.lang.String" itemvalue="wsaccel" />
<item index="174" class="java.lang.String" itemvalue="manuf" />
<item index="175" class="java.lang.String" itemvalue="py-cpuinfo" />
<item index="176" class="java.lang.String" itemvalue="pycodestyle" />
<item index="177" class="java.lang.String" itemvalue="pyasn1" />
<item index="178" class="java.lang.String" itemvalue="apksigcopier" />
<item index="179" class="java.lang.String" itemvalue="sniffio" />
<item index="180" class="java.lang.String" itemvalue="wifite" />
<item index="181" class="java.lang.String" itemvalue="sphinxcontrib-devhelp" />
<item index="182" class="java.lang.String" itemvalue="smartypants" />
<item index="183" class="java.lang.String" itemvalue="zipp" />
<item index="184" class="java.lang.String" itemvalue="pkginfo" />
<item index="185" class="java.lang.String" itemvalue="itsdangerous" />
<item index="186" class="java.lang.String" itemvalue="blinker" />
<item index="187" class="java.lang.String" itemvalue="smbus" />
<item index="188" class="java.lang.String" itemvalue="botocore" />
<item index="189" class="java.lang.String" itemvalue="pyasn1_modules" />
<item index="190" class="java.lang.String" itemvalue="shyysh" />
<item index="191" class="java.lang.String" itemvalue="incremental" />
<item index="192" class="java.lang.String" itemvalue="netsnmp-python" />
<item index="193" class="java.lang.String" itemvalue="toml" />
<item index="194" class="java.lang.String" itemvalue="termcolor" />
<item index="195" class="java.lang.String" itemvalue="pre_commit" />
<item index="196" class="java.lang.String" itemvalue="pwquality" />
<item index="197" class="java.lang.String" itemvalue="pyaml" />
<item index="198" class="java.lang.String" itemvalue="Sphinx" />
<item index="199" class="java.lang.String" itemvalue="vkbasalt-cli" />
<item index="200" class="java.lang.String" itemvalue="typing_extensions" />
<item index="201" class="java.lang.String" itemvalue="cachetools" />
<item index="202" class="java.lang.String" itemvalue="vdf" />
<item index="203" class="java.lang.String" itemvalue="dbus-python" />
<item index="204" class="java.lang.String" itemvalue="yarl" />
<item index="205" class="java.lang.String" itemvalue="Twisted" />
<item index="206" class="java.lang.String" itemvalue="sphinxcontrib-applehelp" />
<item index="207" class="java.lang.String" itemvalue="FVS" />
<item index="208" class="java.lang.String" itemvalue="Automat" />
<item index="209" class="java.lang.String" itemvalue="python-dateutil" />
<item index="210" class="java.lang.String" itemvalue="frida" />
<item index="211" class="java.lang.String" itemvalue="QtPy" />
<item index="212" class="java.lang.String" itemvalue="setuptools" />
<item index="213" class="java.lang.String" itemvalue="cycler" />
<item index="214" class="java.lang.String" itemvalue="jaraco.text" />
<item index="215" class="java.lang.String" itemvalue="MarkupSafe" />
<item index="216" class="java.lang.String" itemvalue="constantly" />
<item index="217" class="java.lang.String" itemvalue="httptools" />
<item index="218" class="java.lang.String" itemvalue="frozenlist" />
<item index="219" class="java.lang.String" itemvalue="snowballstemmer" />
<item index="220" class="java.lang.String" itemvalue="libtorrent" />
<item index="221" class="java.lang.String" itemvalue="appdirs" />
<item index="222" class="java.lang.String" itemvalue="playwright" />
<item index="223" class="java.lang.String" itemvalue="TBB" />
<item index="224" class="java.lang.String" itemvalue="certifi" />
<item index="225" class="java.lang.String" itemvalue="PyQt5_sip" />
<item index="226" class="java.lang.String" itemvalue="anyio" />
<item index="227" class="java.lang.String" itemvalue="jaraco.functools" />
<item index="228" class="java.lang.String" itemvalue="Markdown" />
<item index="229" class="java.lang.String" itemvalue="KismetCaptureFreaklabsZigbee" />
<item index="230" class="java.lang.String" itemvalue="xxhash" />
<item index="231" class="java.lang.String" itemvalue="nodeenv" />
<item index="232" class="java.lang.String" itemvalue="patool" />
<item index="233" class="java.lang.String" itemvalue="shtab" />
<item index="234" class="java.lang.String" itemvalue="kismet_rest" />
<item index="235" class="java.lang.String" itemvalue="kiwisolver" />
<item index="236" class="java.lang.String" itemvalue="zope.interface" />
<item index="237" class="java.lang.String" itemvalue="sphinxcontrib-htmlhelp" />
<item index="238" class="java.lang.String" itemvalue="fonttools" />
<item index="239" class="java.lang.String" itemvalue="pyelftools" />
<item index="240" class="java.lang.String" itemvalue="readme_renderer" />
<item index="241" class="java.lang.String" itemvalue="virtualenv" />
<item index="242" class="java.lang.String" itemvalue="nh3" />
<item index="243" class="java.lang.String" itemvalue="pyfiglet" />
<item index="244" class="java.lang.String" itemvalue="setuptools-reproducible" />
<item index="245" class="java.lang.String" itemvalue="more-itertools" />
<item index="246" class="java.lang.String" itemvalue="SQLAlchemy" />
<item index="247" class="java.lang.String" itemvalue="pytest-xdist" />
<item index="248" class="java.lang.String" itemvalue="python-editor" />
<item index="249" class="java.lang.String" itemvalue="shiboken6" />
<item index="250" class="java.lang.String" itemvalue="jeepney" />
<item index="251" class="java.lang.String" itemvalue="flake8" />
<item index="252" class="java.lang.String" itemvalue="typing-inspection" />
<item index="253" class="java.lang.String" itemvalue="umu-launcher" />
<item index="254" class="java.lang.String" itemvalue="steam" />
<item index="255" class="java.lang.String" itemvalue="urllib3" />
<item index="256" class="java.lang.String" itemvalue="Flask" />
<item index="257" class="java.lang.String" itemvalue="pytest-repeat" />
<item index="258" class="java.lang.String" itemvalue="jaraco.collections" />
<item index="259" class="java.lang.String" itemvalue="pytest" />
<item index="260" class="java.lang.String" itemvalue="sphinxcontrib-serializinghtml" />
<item index="261" class="java.lang.String" itemvalue="pacman_mirrors" />
<item index="262" class="java.lang.String" itemvalue="wheel" />
<item index="263" class="java.lang.String" itemvalue="banal" />
<item index="264" class="java.lang.String" itemvalue="nftables" />
<item index="265" class="java.lang.String" itemvalue="grpcio-tools" />
<item index="266" class="java.lang.String" itemvalue="zstandard" />
<item index="267" class="java.lang.String" itemvalue="tqdm" />
<item index="268" class="java.lang.String" itemvalue="pixelmatch" />
<item index="269" class="java.lang.String" itemvalue="fastapi" />
<item index="270" class="java.lang.String" itemvalue="btrfsutil" />
<item index="271" class="java.lang.String" itemvalue="build" />
<item index="272" class="java.lang.String" itemvalue="pipx" />
<item index="273" class="java.lang.String" itemvalue="udiskie" />
<item index="274" class="java.lang.String" itemvalue="colorama" />
<item index="275" class="java.lang.String" itemvalue="pillow" />
<item index="276" class="java.lang.String" itemvalue="grpcio" />
<item index="277" class="java.lang.String" itemvalue="aiosignal" />
</list>
</value>
</option>
</inspection_tool>
</profile>
</component>
+6
View File
@@ -0,0 +1,6 @@
<component name="InspectionProjectProfileManager">
<settings>
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>
+8
View File
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/dify_zcd_tool_mob_ya_music_control.iml" filepath="$PROJECT_DIR$/.idea/dify_zcd_tool_mob_ya_music_control.iml" />
</modules>
</component>
</project>
Generated
+6
View File
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
+397
View File
@@ -0,0 +1,397 @@
import asyncio
import base64
import json
import os
import random
import time
from datetime import datetime
import requests
from dotenv import load_dotenv
from yandex_music import ClientAsync, Client, Track
from yandex_music.exceptions import NetworkError
# from yandex_music.exceptions import NetworkError
from yandex_music.playlist.playlist import Playlist
load_dotenv(verbose=True)
SEARCH_TAG_PREFIX = 'req'
MESSAGE_CMD__PLAY_TRACK_RAW = '#play_track'
MESSAGE_CMD__PLAY_FAVORITES_RAW = '#play_favorites'
POSTFIX_URL_PLAY = ''
#POSTFIX_URL_PLAY = '?play=true'
TARGET_CONTROL_PLAYLIST_NAME = '#play'
TARGET_CONTROL_PLAYLIST_URL_FORMAT = 'https://music.yandex.com/users/{user_id}/playlists/{playlist_id}'
TRACK_URL_FORMAT = 'https://music.yandex.com/album/{album_id}/track/{track_id}'
FAVORITE_PLAYLIST_URL_FORMAT = 'https://music.yandex.com/users/{user_id}/playlists/3'
type_to_name = {
'track': 'трек', 'artist': 'исполнитель', 'album': 'альбом', 'playlist': 'плейлист',
'video': 'видео', 'user': 'пользователь', 'podcast': 'подкаст', 'podcast_episode': 'эпизод подкаста',
}
class YaMusicCustom:
def __init__(self, **kwargs):
# self.client = client
self.client = ClientAsync(token=kwargs['token'])
# await self.init()
async def init(self):
await self.client.init()
@staticmethod
def _fix_revision_bug(object_with_revision_param):
object_with_revision_param.revision += 1
return object_with_revision_param
async def send_search_request_and_print_result(self, query):
query = f'{query} трек'
best_object = None
search_result = await self.client.search(query)
text = [f'[*] Результаты по запросу "{query}":']
best_result_text = ''
if search_result.best:
type_ = search_result.best.type
best_object = search_result.best.result
# text.append(f'[+] Лучший результат: <{}> {type_to_name.get(type_)}')
if type_ in ['track', 'podcast_episode']:
artists = ''
if best_object.artists:
artists = ' - ' + ', '.join(artist.name for artist in best_object.artists)
best_result_text = best_object.title + artists
elif type_ == 'artist':
best_result_text = best_object.name
elif type_ in ['album', 'podcast']:
best_result_text = best_object.title
elif type_ == 'playlist':
best_result_text = best_object.title
elif type_ == 'video':
best_result_text = f'{best_object.title} {best_object.text}'
text.append(f' [+] Лучший результат: <{type_to_name.get(type_)}> {best_result_text}')
if search_result.artists:
text.append(f' [*] Исполнителей: {search_result.artists.total}')
if search_result.albums:
text.append(f' [*] Альбомов: {search_result.albums.total}')
if search_result.tracks:
text.append(f' [*] Треков: {search_result.tracks.total}')
if search_result.playlists:
text.append(f' [*] Плейлистов: {search_result.playlists.total}')
if search_result.videos:
text.append(f' [*] Видео: {search_result.videos.total}')
text.append('')
print('\n'.join(text))
return best_result_text, best_object
async def get_create_controller_playlist(self) -> Playlist:
all_user_playlist = await self.client.users_playlists_list()
# parse and search target controller playlist
for user_playlist in all_user_playlist:
if user_playlist.custom_wave.title == TARGET_CONTROL_PLAYLIST_NAME:
return user_playlist
print('[*] Playlist was not found, recreate..')
# create and return playlist
# # get user account object
user_account = await self.client.account_status()
# # get user uid
user_uid = user_account.account.uid
# # create playlist
playlist = await self.client.users_playlists_create(user_id=user_uid, title=TARGET_CONTROL_PLAYLIST_NAME)
# return created playlist
return playlist
@staticmethod
async def clean_playlist(playlist: Playlist):
playlist_tracks = await playlist.fetch_tracks_async()
if len(playlist_tracks) != 0:
await playlist.delete_tracks_async(0, len(playlist_tracks))
async def add_track_to_playlist(self, playlist: Playlist, track: Track):
await self.clean_playlist(playlist)
track_id, album_id = track.track_id.split(':')
#
async def insert_track_async(i_track_id, i_album_id, i_playlist, fix_revision_bug=False):
if fix_revision_bug:
i_playlist = self._fix_revision_bug(object_with_revision_param=i_playlist)
await i_playlist.insert_track_async(track_id=int(i_track_id),
album_id=int(i_album_id))
# add track to playlist
while True:
try:
dt_start = datetime.now()
await insert_track_async(i_track_id=track_id, i_album_id=album_id, i_playlist=playlist)
print(f' [*] Insert track time (common) : {datetime.now() - dt_start}')
break
except NetworkError:
print(f' [*] Insert track time (with error) : {datetime.now() - dt_start}')
dt_start = datetime.now()
await insert_track_async(i_track_id=track_id, i_album_id=album_id, i_playlist=playlist,
fix_revision_bug=True)
print(f' [*] Insert track time (fix revision) : {datetime.now() - dt_start}')
break
except Exception as ex:
print(ex)
await asyncio.sleep(.1)
dt_start = datetime.now()
# find track in playlist
while True:
playlist_tracks = await playlist.fetch_tracks_async()
for p_track in playlist_tracks:
if track.id == p_track.id:
print(f' [*] Check track in playlist exist time : {datetime.now() - dt_start}')
return
await asyncio.sleep(.1)
@staticmethod
def get_controller_playlist_url(playlist: Playlist, turn_play=False):
url = TARGET_CONTROL_PLAYLIST_URL_FORMAT.format(user_id=playlist.owner.login,
playlist_id=playlist.kind)
return url if not turn_play else f'{url}{POSTFIX_URL_PLAY}'
@staticmethod
def get_track_url(track: Track, turn_play=False):
track_id, album_id = track.track_id.split(':')
url = TRACK_URL_FORMAT.format(track_id=track_id, album_id=album_id)
return url if not turn_play else f'{url}{POSTFIX_URL_PLAY}'
class NtfyServerInterface:
def __init__(self, ntfy_server: str,
ntfy_send_topic: str,
ntfy_send_user: str,
ntfy_send_pass: str,
ntfy_read_topic: str,
ntfy_read_user: str,
ntfy_read_pass: str,):
self.NTFY_SERVER = ntfy_server
self.NTFY_SEND_TOPIC = ntfy_send_topic
self.NTFY_SEND_USER = ntfy_send_user
self.NTFY_SEND_PASS = ntfy_send_pass
self.NTFY_READ_TOPIC = ntfy_read_topic
self.NTFY_READ_USER = ntfy_read_user
self.NTFY_READ_PASS = ntfy_read_pass
self.REPEAT_EVERY_IN_SECONDS = 1
self.MAX_TRIES_COUNT = 300
def send_text_notification(self, text_to_send: str ):
url = f"{self.NTFY_SERVER}/{self.NTFY_SEND_TOPIC}"
# make request
# make auth
session_auth = (self.NTFY_SEND_USER, self.NTFY_SEND_PASS)
r_response = requests.post(url, data=text_to_send.encode('utf-8'), auth=session_auth)
r_response.raise_for_status() # Raises stored HTTPError if the request failed
return r_response.status_code
def listen_and_get_media_message(self, search_text: str) -> (str, str):
try:
tries_count = 0
while tries_count < self.MAX_TRIES_COUNT:
url = f"{self.NTFY_SERVER}/{self.NTFY_READ_TOPIC}/json?poll=1"
# make auth
session_auth = (self.NTFY_READ_USER, self.NTFY_READ_PASS)
headers = {
"Accept": "text/event-stream"
}
resp = requests.get(url, auth=session_auth, headers=headers)
last_events = [json.loads(i) for i in resp.content.decode('utf-8').split('\n') if i != '']
# enable for #debug
# pprint.pprint(last_events)
for event in last_events:
# pass
# print()
if search_text in event['tags']:
# success
# pprint.pprint(event)
return event, None
tries_count += 1
time.sleep(self.REPEAT_EVERY_IN_SECONDS)
except Exception as ex:
return None, ex
return None, Exception(
f'Timeout, the maximum number of attempts (max time {self.MAX_TRIES_COUNT * self.REPEAT_EVERY_IN_SECONDS} in sec) was called..')
@staticmethod
def download_photo_bin_and_base64_from_ntfy_message(message):
# get url from message object
url = message['attachment']['url']
# fetch the content from the URL
r_response = requests.get(url)
r_response.raise_for_status() # raise error for bad status
# encode the content as base64
encoded = base64.b64encode(r_response.content)
# Convert bytes to string and return
return r_response.content, encoded.decode('utf-8')
def prepare_and_return_result(request_type: str, response_data):
return {'result': {
request_type: response_data
}}
async def main(
i_INPUT_QUERY,
i_REQUEST_TYPE,
i_NTFY_SERVER,
i_NTFY_SEND_TOPIC,
i_NTFY_SEND_USER,
i_NTFY_SEND_PASS,
i_NTFY_READ_TOPIC,
i_NTFY_READ_USER,
i_NTFY_READ_PASS
):
global SEARCH_TAG_PREFIX
global MESSAGE_CMD__PLAY_TRACK_RAW
ntfy_server = NtfyServerInterface(
ntfy_server=i_NTFY_SERVER,
ntfy_send_topic=i_NTFY_SEND_TOPIC,
ntfy_send_user=i_NTFY_SEND_USER,
ntfy_send_pass=i_NTFY_SEND_PASS,
ntfy_read_topic=i_NTFY_READ_TOPIC,
ntfy_read_user=i_NTFY_READ_USER,
ntfy_read_pass=i_NTFY_READ_PASS
)
client = YaMusicCustom(token=os.getenv('YA_TOKEN'))
await client.init()
async def play_single_track_main(request_text: str):
# make search
search_result_text, search_result_track_object = await client.send_search_request_and_print_result(
query=request_text)
if type(search_result_track_object) not in [Track]:
print('[!] No track found, skipping..')
return
# get controller playlist
dt_start = datetime.now()
playlist_controller_object = await client.get_create_controller_playlist()
print(f' [*] Time to add track to playlist (action): {datetime.now() - dt_start}')
# add searched track
dt_start = datetime.now()
await client.add_track_to_playlist(playlist=playlist_controller_object, track=search_result_track_object)
print(f'[*] Time to add track to playlist : {datetime.now() - dt_start}')
# prepare url
playlist_url = client.get_controller_playlist_url(playlist=playlist_controller_object, turn_play=True)
track_url = client.get_track_url(track=search_result_track_object, turn_play=False)
# ### ###
#
# gen current req id
current_req_id = random.randrange(111111, 999999)
# target full request text code
target_msg_request_id = f'{SEARCH_TAG_PREFIX}{current_req_id}'
# prepare send request message
message = f'{MESSAGE_CMD__PLAY_TRACK_RAW}:{target_msg_request_id}:{playlist_url}'
#
# send remote ntfy command
ntfy_server.send_text_notification(text_to_send=message)
#
# ### ###
#
print(f'[*] Result : "playlist_url" - {playlist_url}, "track_url" - {track_url}')
async def play_favorites_track_main():
favorite_url = FAVORITE_PLAYLIST_URL_FORMAT.format(user_id=client.client.me.account.login)
#
# ### ###
#
# gen current req id
current_req_id = random.randrange(111111, 999999)
# target full request text code
target_msg_request_id = f'{SEARCH_TAG_PREFIX}{current_req_id}'
# prepare send request message
message = f'{MESSAGE_CMD__PLAY_FAVORITES_RAW}:{target_msg_request_id}:{favorite_url}'
#
# send remote ntfy command
ntfy_server.send_text_notification(text_to_send=message)
#
# ### ###
#
print(f'[*] Result : "playlist_url" - {favorite_url}')
result_data = None
if i_REQUEST_TYPE == 'play_favorites':
result_data = await play_favorites_track_main()
elif i_REQUEST_TYPE == 'play_track':
result_data = await play_single_track_main(request_text=i_INPUT_QUERY)
# manual track play challenge
elif i_REQUEST_TYPE == '':
# infinite loop for #debug
while True:
# input_query = 'The Salmon Dance'
input_query = input('Введите название трека для поиска: ')
# play track main function
await play_single_track_main(request_text=input_query)
return prepare_and_return_result(request_type=i_REQUEST_TYPE, response_data=result_data)
if __name__ == '__main__':
from dotenv import load_dotenv
# load env from .env
load_dotenv()
# configure
NTFY_SERVER = os.getenv('NTFY_SERVER', '').rstrip('/')
NTFY_SEND_TOPIC = os.getenv('NTFY_SEND_TOPIC', '').lstrip('/')
NTFY_SEND_USER = os.getenv('NTFY_SEND_USER')
NTFY_SEND_PASS = os.getenv('NTFY_SEND_PASS')
NTFY_READ_TOPIC = os.getenv('NTFY_READ_TOPIC', '').lstrip('/')
NTFY_READ_USER = os.getenv('NTFY_READ_USER')
NTFY_READ_PASS = os.getenv('NTFY_READ_PASS')
# #test example to run favorite playlist
asyncio.run(main(
i_REQUEST_TYPE='play_favorites',
i_INPUT_QUERY='',
i_NTFY_SERVER=NTFY_SERVER,
i_NTFY_SEND_TOPIC=NTFY_SEND_TOPIC,
i_NTFY_SEND_USER=NTFY_SEND_USER,
i_NTFY_SEND_PASS=NTFY_SEND_PASS,
i_NTFY_READ_TOPIC=NTFY_READ_TOPIC,
i_NTFY_READ_USER=NTFY_READ_USER,
i_NTFY_READ_PASS=NTFY_READ_PASS
))
# #test example to single run
# asyncio.run(main(
# i_REQUEST_TYPE='play_track',
# i_INPUT_QUERY='Не дано хайфай',
# i_NTFY_SERVER=NTFY_SERVER,
# i_NTFY_SEND_TOPIC=NTFY_SEND_TOPIC,
# i_NTFY_SEND_USER=NTFY_SEND_USER,
# i_NTFY_SEND_PASS=NTFY_SEND_PASS,
# i_NTFY_READ_TOPIC=NTFY_READ_TOPIC,
# i_NTFY_READ_USER=NTFY_READ_USER,
# i_NTFY_READ_PASS=NTFY_READ_PASS
# ))
+8
View File
@@ -0,0 +1,8 @@
[project]
name = "dify-zcd-tool-mob-ya-music-control"
version = "0.1.0"
description = "Add your description here"
requires-python = ">=3.12"
dependencies = [
"python-dotenv>=1.1.1",
]
Generated
+23
View File
@@ -0,0 +1,23 @@
version = 1
revision = 2
requires-python = ">=3.12"
[[package]]
name = "dify-zcd-tool-mob-ya-music-control"
version = "0.1.0"
source = { virtual = "." }
dependencies = [
{ name = "python-dotenv" },
]
[package.metadata]
requires-dist = [{ name = "python-dotenv", specifier = ">=1.1.1" }]
[[package]]
name = "python-dotenv"
version = "1.1.1"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/f6/b0/4bc07ccd3572a2f9df7e6782f52b0c6c90dcbb803ac4a167702d7d0dfe1e/python_dotenv-1.1.1.tar.gz", hash = "sha256:a8a6399716257f45be6a007360200409fce5cda2661e3dec71d23dc15f6189ab", size = 41978, upload-time = "2025-06-24T04:21:07.341Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/5f/ed/539768cf28c661b5b068d66d96a2f155c4971a5d55684a514c1a0e0dec2f/python_dotenv-1.1.1-py3-none-any.whl", hash = "sha256:31f23644fe2602f88ff55e1f5c79ba497e01224ee7737937930c448e4d0e24dc", size = 20556, upload-time = "2025-06-24T04:21:06.073Z" },
]