浏览代码

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

Miek Stagl 5 年之前
父节点
当前提交
b01299fdc7
共有 5 个文件被更改,包括 13 次插入3 次删除
  1. 二进制
      .ytsearch.swp
  2. 二进制
      __pycache__/tg_youtube_search.cpython-38.pyc
  3. 1 1
      config.ini
  4. 10 0
      list.txt
  5. 2 2
      ytsearch

二进制
.ytsearch.swp


二进制
__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
 ## Default Storage Path should point to a folder in teh user's Home directory
 DefaultStoragePath = Music
 DefaultStoragePath = Music
 Retries = 3
 Retries = 3
-Download = True
+Download = False
 Key = AdmufSbEgfzbRjaxHBMvyvdKqBxhNYvCzvXHXWQK
 Key = AdmufSbEgfzbRjaxHBMvyvdKqBxhNYvCzvXHXWQK
 ## creates unique folder name for each download attempt to test various search queries for best results.  Normall False
 ## creates unique folder name for each download attempt to test various search queries for best results.  Normall False
 TestFolder = 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:
 	if len(ALBUM) == 0:
 		album="UNKNOWN ALBUM"
 		album="UNKNOWN ALBUM"
 	else:
 	else:
-		album = ALBUM
+		album = ALBUM.replace("'","")
 #	msg("buildfolders local album is set to: " + album, 3)
 #	msg("buildfolders local album is set to: " + album, 3)
 	global DESTFOLDER
 	global DESTFOLDER
 	DESTFOLDER = artist + "/" + album + "/"
 	DESTFOLDER = artist + "/" + album + "/"
@@ -330,7 +330,7 @@ def downloadsong(link, song):
        msg("Downloadsong DESTFOLDER: " + DESTFOLDER, 3)
        msg("Downloadsong DESTFOLDER: " + DESTFOLDER, 3)
        try:
        try:
          if TOR:
          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:
          else:
            os.system("youtube-dl --extract-audio --audio-format best --audio-quality 0 --output '''" + DESTFOLDER + "%(title)s.%(ext)s' --ignore-errors " + link)
            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'])
          completed.append(song['songnum'])