

def _real_extract(self, url):
    mobj = re.match(self._VALID_URL, url)
    playlist_id = mobj.group('id')
    pllist_url = ('http://everyonesmixtape.com/mixtape.php?a=getMixes&u=-1&linked=%s&explore=' % playlist_id)
    pllist_req = compat_urllib_request.Request(pllist_url)
    pllist_req.add_header('X-Requested-With', 'XMLHttpRequest')
    playlist_list = self._download_json(pllist_req, playlist_id, note='Downloading playlist metadata')
    try:
        playlist_no = next((playlist['id'] for playlist in playlist_list if (playlist['code'] == playlist_id)))
    except StopIteration:
        raise ExtractorError('Playlist id not found')
    pl_url = ('http://everyonesmixtape.com/mixtape.php?a=getMix&id=%s&userId=null&code=' % playlist_no)
    pl_req = compat_urllib_request.Request(pl_url)
    pl_req.add_header('X-Requested-With', 'XMLHttpRequest')
    playlist = self._download_json(pl_req, playlist_id, note='Downloading playlist info')
    entries = [{
        '_type': 'url',
        'url': t['url'],
        'title': t['title'],
    } for t in playlist['tracks']]
    if mobj.group('songnr'):
        songnr = (int(mobj.group('songnr')) - 1)
        return entries[songnr]
    playlist_title = playlist['mixData']['name']
    return {
        '_type': 'playlist',
        'id': playlist_id,
        'title': playlist_title,
        'entries': entries,
    }

dataset/ETHPy150Open yasoob/youtube-dl-GUI/youtube_dl/extractor/everyonesmixtape.py EveryonesMixtapeIE._real_extract/original