Fix flask8 issues. Ready to pull
This commit is contained in:
parent
6a84bb616c
commit
586fd077de
@ -3,12 +3,9 @@ from __future__ import unicode_literals
|
||||
|
||||
import re
|
||||
|
||||
from ..compat import compat_etree_fromstring
|
||||
from ..utils import get_element_by_id, get_element_by_attribute
|
||||
from .common import InfoExtractor
|
||||
|
||||
# TEMP FOR DEV
|
||||
from pprint import pprint as pp
|
||||
|
||||
class PalcoMP3IE(InfoExtractor):
|
||||
IE_NAME = 'PalcoMP3:song'
|
||||
@ -41,11 +38,9 @@ class PalcoMP3IE(InfoExtractor):
|
||||
`_json_ld` function does not fit us."""
|
||||
return self._parse_json(json_ld, display_id, fatal=fatal)
|
||||
|
||||
|
||||
def _extract_common(self, url):
|
||||
artist_id = self._VALID_URL_RE.match(url).group('artist')
|
||||
webpage = self._download_webpage(url, artist_id)
|
||||
print ("Webpage", type(webpage), len(webpage))
|
||||
self.webpage = webpage
|
||||
|
||||
ld = self._get_ld_info(webpage, artist_id)
|
||||
@ -63,16 +58,10 @@ class PalcoMP3IE(InfoExtractor):
|
||||
else:
|
||||
return track
|
||||
|
||||
|
||||
def _get_ld_info(self, webpage, display_id):
|
||||
# player = get_element_by_attribute('id', 'player', webpage, escape_value=False)
|
||||
player = get_element_by_id('player', webpage)
|
||||
pp(player)
|
||||
|
||||
player = get_element_by_id('player', webpage) or \
|
||||
get_element_by_attribute('id', 'player', webpage, escape_value=False)
|
||||
ld = self._search_json_ld(player, display_id, expected_type="MusicGroup")
|
||||
print("LD:")
|
||||
pp(ld)
|
||||
|
||||
return ld
|
||||
|
||||
def _ld_track_process(self, track, ld={'genre': None}):
|
||||
@ -113,14 +102,14 @@ class PalcoMP3ArtistIE(PalcoMP3IE):
|
||||
'playlist_count': 4,
|
||||
},
|
||||
|
||||
# Active famous artist; Very likely to change the playlist a lot
|
||||
# Active famous artist; Very likely to change playlist_count.
|
||||
# {
|
||||
# 'url': 'https://www.palcomp3.com/maiaraemaraisaoficial',
|
||||
# 'info_dict': {
|
||||
# 'id': 'maiaraemaraisaoficial',
|
||||
# 'title': 'Maiara e Maraisa Oficial',
|
||||
# },
|
||||
# 'playlist_count': '>8',
|
||||
# 'playlist_count': 8,
|
||||
# },
|
||||
]
|
||||
|
||||
@ -144,7 +133,8 @@ class PalcoMP3VideoIE(PalcoMP3IE):
|
||||
'upload_date': '20161107',
|
||||
'uploader_id': 'maiaramaraisaoficial',
|
||||
'uploader': 'Maiara e Maraisa',
|
||||
}},
|
||||
}
|
||||
},
|
||||
{
|
||||
'url': 'https://www.palcomp3.com/mckevinho/dog-vagabundo-mc-phe-cachorrera-part-mc-kevinho/#clipe',
|
||||
'add_ie': ['Youtube'],
|
||||
@ -156,13 +146,12 @@ class PalcoMP3VideoIE(PalcoMP3IE):
|
||||
'upload_date': '20170208',
|
||||
'uploader': 'GR6 EXPLODE',
|
||||
'uploader_id': 'gr6explode',
|
||||
}},
|
||||
}
|
||||
},
|
||||
]
|
||||
|
||||
def _real_extract(self, url):
|
||||
track, webpage = super(PalcoMP3VideoIE, self)._real_extract(url, with_webpage=True)
|
||||
print "TRACK"
|
||||
pp(track)
|
||||
|
||||
video_re = r"""
|
||||
(?x)
|
||||
@ -174,13 +163,8 @@ class PalcoMP3VideoIE(PalcoMP3IE):
|
||||
""".format(track['id'])
|
||||
|
||||
m = re.search(video_re, webpage)
|
||||
|
||||
# from IPython import embed
|
||||
# embed()
|
||||
|
||||
if not m:
|
||||
return None
|
||||
|
||||
video_id = m.group('video_id')
|
||||
|
||||
return {
|
||||
|
Loading…
x
Reference in New Issue
Block a user