|
|
@ -9,7 +9,7 @@
|
|
|
|
"""Extract images from https://www.myportfolio.com/"""
|
|
|
|
"""Extract images from https://www.myportfolio.com/"""
|
|
|
|
|
|
|
|
|
|
|
|
from .common import Extractor, Message
|
|
|
|
from .common import Extractor, Message
|
|
|
|
from .. import text
|
|
|
|
from .. import text, exception
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class MyportfolioGalleryExtractor(Extractor):
|
|
|
|
class MyportfolioGalleryExtractor(Extractor):
|
|
|
@ -31,9 +31,8 @@ class MyportfolioGalleryExtractor(Extractor):
|
|
|
|
"pattern": r"https://andrewling\.myportfolio\.com/[^/?&#+]+$",
|
|
|
|
"pattern": r"https://andrewling\.myportfolio\.com/[^/?&#+]+$",
|
|
|
|
"count": ">= 6",
|
|
|
|
"count": ">= 6",
|
|
|
|
}),
|
|
|
|
}),
|
|
|
|
# no explicit title
|
|
|
|
|
|
|
|
("https://stevenilousphotography.myportfolio.com/society", {
|
|
|
|
("https://stevenilousphotography.myportfolio.com/society", {
|
|
|
|
"keyword": "49e7ff6322645c22b409280656202c2736a380c9",
|
|
|
|
"exception": exception.NotFoundError,
|
|
|
|
}),
|
|
|
|
}),
|
|
|
|
# custom domain
|
|
|
|
# custom domain
|
|
|
|
("myportfolio:https://tooco.com.ar/6-of-diamonds-paradise-bird", {
|
|
|
|
("myportfolio:https://tooco.com.ar/6-of-diamonds-paradise-bird", {
|
|
|
@ -89,8 +88,10 @@ class MyportfolioGalleryExtractor(Extractor):
|
|
|
|
if title:
|
|
|
|
if title:
|
|
|
|
title = title.partition(">")[2]
|
|
|
|
title = title.partition(">")[2]
|
|
|
|
user = user[:-len(title)-3]
|
|
|
|
user = user[:-len(title)-3]
|
|
|
|
else:
|
|
|
|
elif user:
|
|
|
|
user, _, title = user.partition(" - ")
|
|
|
|
user, _, title = user.partition(" - ")
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
raise exception.NotFoundError()
|
|
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
"user": text.unescape(user),
|
|
|
|
"user": text.unescape(user),
|
|
|
|