def test(): songs = make_songs(['442723', '442727']) print_songs(songs) albums = make_albums(['42967']) print_albums(albums) playlists = make_playlists(['190990']) print_playlists(playlists)
def down(url, config): reg = re.compile('http://music.163.com/#/(.+?)\?id=(.+)') matches = reg.findall(url) if not matches: return output_folder = config['output'] if not os.path.exists(output_folder): os.makedirs(output_folder) type, id = matches[0] if type == 'song': songs = make_songs([id]) download_songs(songs, config) elif type == 'album': albums = make_albums([id]) download_albums(albums, config) elif type == 'playlist': playlists = make_playlists([id]) download_playlists(playlists, config) elif type == 'artist': artists = make_artists([id]) download_artists(artists, config)