def from_url_xm(xm_obj, url, verbose=True):
    """ parse the input string (xiami url), and do download"""

    LOG.debug('processing xiami url: "%s"'% url)
    msg = u''
    if '/collect/' in url:
        collect = xm.Collection(xm_obj, url)
        total_songs.extend(collect.songs)
        msgs = [ fmt_parsing % (xiami_url_abbr(url), msgTxt.collection ,collect.collection_name)]
        if verbose:
            for s in collect.songs:
                msgs.append( fmt_single_song % s.song_name)
            msg = u'\n    |-> '.join(msgs)
        else:
            msgs.append(fmt_has_song_nm % len(collect.songs))
            msg= u' => '.join(msgs)

    elif '/song/' in url:
        song = xm.XiamiSong(xm_obj, url=url)
        total_songs.append(song)
        msg = fmt_parsing % (xiami_url_abbr(url),msgTxt.song,  song.song_name)
    elif url in '/album/':
        album = xm.Album(xm_obj, url)
        total_songs.extend(album.songs)
        msgs = [fmt_parsing % (xiami_url_abbr(url),msgTxt.album,  album.artist_name+u' => '+album.album_name)]
        if verbose:
            for s in album.songs:
                msgs.append(fmt_single_song %s.song_name)
            msg = u'\n    |-> '.join(msgs)
        else:
            msgs.append(fmt_has_song_nm % len(album.songs))
            msg= u' => '.join(msgs)

    elif '/lib-song/u/' in url:
        if verbose:
            LOG.warning(msgTxt.warning_many_collections)

        fav = xm.Favorite(xm_obj, url, verbose)
        total_songs.extend(fav.songs)
        msgs = [fmt_parsing % (xiami_url_abbr(url), msgTxt.Favorite ,'')]
        if verbose:
            for s in fav.songs:
                msgs.append(fmt_single_song %s.song_name)
            msg = u'\n    |-> '.join(msgs)
        else:
            msgs.append( fmt_has_song_nm % len(fav.songs))
            msg = u' => '.join(msgs)
    elif re.search(r'/artist/', url):
        topsong=xm.TopSong(xm_obj, url)
        total_songs.extend(topsong.songs)
        msgs = [fmt_parsing % (xiami_url_abbr(url), msgTxt.artistTop,topsong.artist_name)]
        if verbose:
            for s in topsong.songs:
                msgs.append(fmt_single_song %s.song_name)
            msg = u'\n    |-> '.join(msgs)
        else:
            msgs.append( fmt_has_song_nm % len(topsong.songs))
            msg = u' => '.join(msgs)
        

    global total, done
    done +=1
    pre = ('[%d/%d] ' % (done, total)) if not verbose else ''
    if not msg:
        #unknown url
        LOG.error(msgTxt.fmt_xm_unknown_url % (pre,url))
    else:
        LOG.info(u'%s%s'% (pre,msg))
dataset/ETHPy150Open sk1418/zhuaxia/zhuaxia/commander.py/from_url_xm/swapped operands of `in`