slight improvements

This commit is contained in:
David Daily 2022-05-20 15:25:56 -05:00
parent e93914745e
commit b0ff92e541
3 changed files with 13 additions and 36 deletions

View File

@ -6,15 +6,11 @@ verify_ssl = true
[dev-packages]
[packages]
requests = "*"
ytmusicapi = "*"
uuid = "*"
dpath = "*"
pathlib = "*"
numpy = "*"
[requires]
python_version = "3.6"
[scripts]
eggsecute = "python shuffler.py"
eggsecute = "python shuffler.py"

29
Pipfile.lock generated
View File

@ -1,7 +1,7 @@
{
"_meta": {
"hash": {
"sha256": "a8f2591870202c097da45f89a2c17ff6dba87785879d9f36d37c73d9dc87402d"
"sha256": "e53ae55a3319ea44efef950ac0530afdafe2e7110d9f1de7a68a606c86b49dff"
},
"pipfile-spec": 6,
"requires": {
@ -21,6 +21,7 @@
"sha256:9c5705e395cd70084351dd8ad5c41e65655e08ce46f2ec9cf6c2c08390f71eb7",
"sha256:f1d53542ee8cbedbe2118b5686372fb33c297fcd6379b050cca0ef13a597382a"
],
"markers": "python_version >= '3.6'",
"version": "==2022.5.18.1"
},
"charset-normalizer": {
@ -31,14 +32,6 @@
"markers": "python_version >= '3'",
"version": "==2.0.12"
},
"dpath": {
"hashes": [
"sha256:5a1ddae52233fbc8ef81b15fb85073a81126bb43698d3f3a1b6aaf561a46cdc0",
"sha256:8c439bb1c3b3222427e9b8812701cd99a0ef3415ddbb7c03a2379f6989a03965"
],
"index": "pypi",
"version": "==2.0.6"
},
"idna": {
"hashes": [
"sha256:84d9dd047ffa80596e0f246e2eab0b391788b0503584e8945f2368256d2735ff",
@ -87,20 +80,12 @@
"index": "pypi",
"version": "==1.19.5"
},
"pathlib": {
"hashes": [
"sha256:6940718dfc3eff4258203ad5021090933e5c04707d5ca8cc9e73c94a7894ea9f",
"sha256:f35f95ab8b0f59e6d354090350b44a80a80635d22efdedfa84c7ad1cf0a74147"
],
"index": "pypi",
"version": "==1.0.1"
},
"requests": {
"hashes": [
"sha256:68d7c56fd5a8999887728ef304a6d12edc7be74f1cfa47714fc8b414525c9a61",
"sha256:f22fa1e554c9ddfd16e6e41ac79759e17be9e492b3587efa038054674760e72d"
],
"index": "pypi",
"markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5'",
"version": "==2.27.1"
},
"urllib3": {
@ -108,15 +93,9 @@
"sha256:44ece4d53fb1706f667c9bd1c648f5469a2ec925fcf3a776667042d645472c14",
"sha256:aabaf16477806a5e1dd19aa41f8c2b7950dd3c746362d7e3223dbe6de6ac448e"
],
"markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' and python_version < '4'",
"version": "==1.26.9"
},
"uuid": {
"hashes": [
"sha256:1f87cc004ac5120466f36c5beae48b4c48cc411968eed0eaecd3da82aa96193f"
],
"index": "pypi",
"version": "==1.30"
},
"ytmusicapi": {
"hashes": [
"sha256:099e2ea16e141e7e42f8c724417cac4ddc9d680a67f7d6f45029c5e513dbec32",

View File

@ -1,7 +1,6 @@
import json
import datetime as dt
import os
from dpath import util
import sys
import numpy as np
from ytmusicapi import YTMusic
ytmusic = YTMusic("config.json")
@ -9,8 +8,12 @@ ytmusic = YTMusic("config.json")
# I tried the "interactive" authentication but wasn't having luck with it
# Add the name of the playlist you want to shuffle here
to_shuffle = 'Sleep'
# Add the name of the playlist you want to shuffle here, or provide it as a command line argument
if sys.argv[1]:
to_shuffle = str(sys.argv[1])
else:
to_shuffle = 'playlist name here'
def get_playlistID(name):
@ -48,5 +51,4 @@ shuffled['description'] = 'Shuffled ' + now
shuffled['video_ids'] = track_ids
shuffled['privacy_status'] = privacy
ytmusic.create_playlist(**shuffled)
print(f'The playlist called \"{to_shuffle}\" has been shuffled!')
#TODO and UI: auth and playlist name
print(f'The playlist called \"{to_shuffle}\" has been shuffled!')