Skip to content

Commit 0dc182d

Browse files
authored
Update paapi.py
get_asin to return asin if asin is supplier else get asin from URL.
1 parent 4456494 commit 0dc182d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

amazon/paapi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def get_asin(url):
5757
Returns:
5858
string: Product ASIN. None if ASIN not found.
5959
"""
60-
if re.search("[A-Z0-9]{10}", url):
60+
if re.search("^[A-Z0-9]{10}$", url):
6161
return url
6262
# since asin is alphanumeric and 10 digit
6363
have_asin = re.search(r"(dp|gp/product)/([a-zA-Z0-9]{10})", url)

0 commit comments

Comments
 (0)