Skip to content
This repository has been archived by the owner on Mar 8, 2023. It is now read-only.

Commit

Permalink
extractors/pinterest: 🔧
Browse files Browse the repository at this point in the history
  • Loading branch information
iawia002 committed Mar 3, 2018
1 parent d3f2d7e commit eae25a8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
10 changes: 4 additions & 6 deletions lulu/extractors/pinterest.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ class Pinterest(VideoExtractor):
def prepare(self, **kwargs):
# scrape the html
content = get_content(self.url)
pin_id = match1(self.url, r'https?://www.pinterest.com/pin/(\d+)')
# extract title
self.title = match1(
content,
Expand All @@ -38,11 +37,10 @@ def prepare(self, **kwargs):
r'</script>'
)
data = json.loads(data)
orig_img = data['resources']['data']['PinResource'][
'field_set_key="unauth_react_pin",get_page_metadata=true,'
'id="{}",main_module_name="UnauthPinReactPage",'
'pure_react=true,python_resource_prefetch=true'.format(pin_id)
]['data']['images']['orig']['url']
keys = list(data['resources']['data']['PinResource'].keys())
orig_img = data['resources']['data']['PinResource'][keys[0]]['data'][
'images'
]['orig']['url']
twit_img = match1(
content,
r'<meta property="twitter:image:src" name="twitter:image:src" '
Expand Down
3 changes: 0 additions & 3 deletions tests/test_extractors.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,6 @@ def test_qq(self):

@ignore_network_issue
def test_acfun(self):
extractors.acfun.download(
'http://www.acfun.cn/v/ac4209715', info_only=True
)
extractors.acfun.download(
'http://www.acfun.cn/v/ac4210425', info_only=True
)
Expand Down

0 comments on commit eae25a8

Please sign in to comment.