Commit 6af5537d authored by Slack's avatar Slack

Merge branch 'develop'

parents 519d5560 3bae1cf1
......@@ -37,8 +37,10 @@ SCRAPER_URL = 'https://play.google.com/store/music/'
class GoogleplayMixin(object):
def get_headers(self):
headers = self.headers.copy()
headers.update({'accept-language': 'en-GB,en;q=0.9,de;q=0.7'})
headers = {
'User-Agent': 'curl/7.52.1',
'accept-language': 'en-GB,en;q=0.9,de;q=0.7'
}
return headers
def process_initial_data(self, initial_data):
......@@ -122,7 +124,7 @@ class Scraper(GoogleplayMixin, GetReleaseResultMixin, ScraperBase, RequestMixin,
self.result.append_genre(genre_a.text_content())
def add_release_title(self):
title_h1 = self.data.cssselect('h1.document-title span[itemprop="name"]')
title_h1 = self.data.cssselect('.document-title *[itemprop="name"]')
if len(title_h1) != 1:
self.raise_exception(u'could not find album title h1')
title_h1 = title_h1[0]
......
......@@ -35,20 +35,20 @@ class GoogleplayTest(TestCase):
u'format': u'MP3',
u'genres': [u'Alternative/Indie'],
u'url': u'https://play.google.com/store/music/album/M%C3%BAm_Finally_We_Are_No_One?id=Bdwfqucjvuosybdppd5ztoomooa',
u'labelIds': [{u'catalogueNrs': [], u'label': u'Fatcat Records ([PIAS] Recordings)'}],
u'releaseEvents': u'20 March 2002',
u'labelIds': [{u'catalogueNrs': [], u'label': u'FatCat Records'}],
u'releaseEvents': u'20 May 2002',
u'discs': [
[
[u'Sleep/Swim', 50],
[u'Green Green Grass Of Tunnel', 291],
[u'We Have A Map Of The Piano', 319],
[u'Green Grass of Tunnel', 291],
[u'We Have a Map of the Piano', 319],
[u'Don\'t Be Afraid, You Have Just Got Your Eyes Closed', 343],
[u'Behind Two Hills…A Swimming Pool', 68],
[u'Behind Two Hills,,,,A Swimmingpool', 68],
[u'K/Half Noise', 521],
[u'Now There\'s That Fear Again', 236],
[u'Faraway Swimming Pool', 175],
[u'I Can\'t Feel My Hand Any More, Its Alright, Sleep Still', 340],
[u'Finally We Are No-one', 307],
[u'Faraway Swimmingpool', 175],
[u'I Can\'t Feel My Hand Any More, It\'s Alright, Sleep Still', 340],
[u'Finally We Are No One', 307],
[u'The Land Between Solar Systems', 718],
]
]
......@@ -66,7 +66,7 @@ class GoogleplayTest(TestCase):
u'artists': u'Faith No More',
u'title': u'Angel Dust (Deluxe Edition)',
u'format': u'MP3',
u'genres': [u'Rock', u'Pop'],
u'genres': [u'Alt Metal', u'Metal', u'Alternative/Indie', u'Rock', u"90's Alternative", u'Hard Rock'],
u'url': u'https://play.google.com/store/music/album/Faith_No_More_Angel_Dust_Deluxe_Edition?id=Bsbdhlang4ndnzwjcmj7jjvrc4y',
u'labelIds': [{u'catalogueNrs': [], u'label': u'WM UK'}],
u'releaseEvents': u'8 June 1992',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment