Преглед изворни кода

small change to avoid apostrophe in album name in file folder creation

Miek Stagl пре 5 година
родитељ
комит
b01299fdc7
5 измењених фајлова са 13 додато и 3 уклоњено
  1. BIN
      .ytsearch.swp
  2. BIN
      __pycache__/tg_youtube_search.cpython-38.pyc
  3. 1 1
      config.ini
  4. 10 0
      list.txt
  5. 2 2
      ytsearch

BIN
__pycache__/tg_youtube_search.cpython-38.pyc


+ 1 - 1
config.ini

@@ -3,7 +3,7 @@ Musicfile = list.txt
 ## Default Storage Path should point to a folder in teh user's Home directory
 DefaultStoragePath = Music
 Retries = 3
-Download = True
+Download = False
 Key = AdmufSbEgfzbRjaxHBMvyvdKqBxhNYvCzvXHXWQK
 ## creates unique folder name for each download attempt to test various search queries for best results.  Normall False
 TestFolder = False

+ 10 - 0
list.txt

@@ -0,0 +1,10 @@
+Hit The Lights, Metallica
+The Four Horsemen, Metallica
+Motorbreath, Metallica
+Jump In The Fire, Metallica
+(Anesthesia)-Pulling Teeth, Metallica
+Whiplash, Metallica
+Phantom Lord, Metallica
+No Remorse, Metallica
+Seek & Destroy, Metallica
+Metal Militia, Metallica

+ 2 - 2
ytsearch

@@ -208,7 +208,7 @@ def buildfolders(artist, album=""):
 	if len(ALBUM) == 0:
 		album="UNKNOWN ALBUM"
 	else:
-		album = ALBUM
+		album = ALBUM.replace("'","")
 #	msg("buildfolders local album is set to: " + album, 3)
 	global DESTFOLDER
 	DESTFOLDER = artist + "/" + album + "/"
@@ -330,7 +330,7 @@ def downloadsong(link, song):
        msg("Downloadsong DESTFOLDER: " + DESTFOLDER, 3)
        try:
          if TOR:
-           os.system(".torsocks youtube-dl --extract-audio --audio-format best --audio-quality 0 --output '''" + DESTFOLDER + "%(title)s.%(ext)s' --ignore-errors " + link)
+           os.system("torsocks youtube-dl --extract-audio --audio-format best --audio-quality 0 --output ''" + DESTFOLDER + "%(title)s.%(ext)s' --ignore-errors " + link)
          else:
            os.system("youtube-dl --extract-audio --audio-format best --audio-quality 0 --output '''" + DESTFOLDER + "%(title)s.%(ext)s' --ignore-errors " + link)
          completed.append(song['songnum'])