mirror of
https://github.com/fergalmoran/picard.git
synced 2026-01-08 09:33:59 +00:00
Allow extract amazon host and asin for https
This commit is contained in:
@@ -213,7 +213,7 @@ def parse_amazon_url(url):
|
||||
"""Extract host and asin from an amazon url.
|
||||
It returns a dict with host and asin keys on success, None else
|
||||
"""
|
||||
r = re.compile(r'^http://(?:www.)?(?P<host>.*?)(?:\:[0-9]+)?/.*/(?P<asin>[0-9B][0-9A-Z]{9})(?:[^0-9A-Z]|$)')
|
||||
r = re.compile(r'^(http|https)://(?:www.)?(?P<host>.*?)(?:\:[0-9]+)?/.*/(?P<asin>[0-9B][0-9A-Z]{9})(?:[^0-9A-Z]|$)')
|
||||
match = r.match(url)
|
||||
if match is not None:
|
||||
return match.groupdict()
|
||||
|
||||
Reference in New Issue
Block a user