pengdaqian commited on
Commit
f5b2ba1
·
1 Parent(s): 2e2adc3
Files changed (2) hide show
  1. app.py +4 -1
  2. music/search.py +5 -0
app.py CHANGED
@@ -243,7 +243,10 @@ def svc_main(sid, input_audio):
243
 
244
 
245
  def auto_search(name):
246
- config = {'logfilepath': 'musicdl.log', 'savedir': 'downloaded', 'search_size_per_source': 5, 'proxies': {}}
 
 
 
247
  albums = get_albums(keywords=name, config=config)
248
  album = random.choice(albums)
249
  save_path = get_random_spit(album)
 
243
 
244
 
245
  def auto_search(name):
246
+ save_music_path = 'downloaded'
247
+ if not os.path.exists(save_music_path):
248
+ os.makedirs(save_music_path)
249
+ config = {'logfilepath': 'musicdl.log', save_music_path: 'downloaded', 'search_size_per_source': 5, 'proxies': {}}
250
  albums = get_albums(keywords=name, config=config)
251
  album = random.choice(albums)
252
  save_path = get_random_spit(album)
music/search.py CHANGED
@@ -89,3 +89,8 @@ def get_random_spit(songinfo):
89
  middle_30s = song[left_idx:right_idx]
90
  middle_30s.export(save_path, format="wav")
91
  return save_path
 
 
 
 
 
 
89
  middle_30s = song[left_idx:right_idx]
90
  middle_30s.export(save_path, format="wav")
91
  return save_path
92
+
93
+
94
+ if __name__ == '__main__':
95
+ config = {'logfilepath': 'musicdl.log', 'downloaded': 'downloaded', 'search_size_per_source': 5, 'proxies': {}}
96
+ get_albums('tayler', config)