def __init__(self, args):
     self.downloader = get_downloader(args.tool)
     self.force_mode = args.force
     self.name_template = args.name_template
     self.song_track_db = {}
     self.no_lrc_timetag = args.no_lrc_timetag
     self.directory = args.directory
Example #2
0
 def __init__(self, args):
     self.force_mode = False
     self.downloader = get_downloader(args.tool)
     self.force_mode = args.force
     self.name_template = args.name_template
     self.song_track_db = {}
Example #3
0
    # Note:
    # mutagen only write id3v2 with v2.4 spec,
    # which win-os does not support;
    # save(v1=2) will write id3v1,
    # but that requires encoding=0 (latin-1),
    # which breaks utf-8, so no good solution for win-os.
    musicfile.save()


if __name__ == '__main__':

    args = parse_arguments()

    xiami = XiamiDownloader()
    xiami.downloader = get_downloader(args.tool)
    xiami.force_mode = args.force

    urls = []

    if args.song:
        urls.extend(build_url_list(URL_PATTERN_SONG, args.song))
    if args.album:
        urls.extend(build_url_list(URL_PATTERN_ALBUM, args.album))
    if args.playlist:
        urls.extend(build_url_list(URL_PATTERN_PLAYLIST, args.playlist))

    # parse playlist xml for a list of track info
    tracks = []
    for playlist_url in urls:
        for url in get_playlist_from_url(playlist_url):
Example #4
0
 def __init__(self, args):
     self.force_mode = False
     self.downloader = get_downloader(args.tool)
     self.force_mode = args.force
     self.name_template = args.name_template
Example #5
0
    # Note:
    # mutagen only write id3v2 with v2.4 spec,
    # which win-os does not support;
    # save(v1=2) will write id3v1,
    # but that requires encoding=0 (latin-1),
    # which breaks utf-8, so no good solution for win-os.
    musicfile.save()


if __name__ == '__main__':

    args = parse_arguments()

    xiami = XiamiDownloader()
    xiami.downloader = get_downloader(args.tool)
    xiami.force_mode = args.force

    urls = []

    if args.song:
        urls.extend(build_url_list(URL_PATTERN_SONG, args.song))
    if args.album:
        urls.extend(build_url_list(URL_PATTERN_ALBUM, args.album))
    if args.playlist:
        urls.extend(build_url_list(URL_PATTERN_PLAYLIST, args.playlist))

    # parse playlist xml for a list of track info
    tracks = []
    for playlist_url in urls:
        for url in get_playlist_from_url(playlist_url):