Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[osen] Make www subdomain optional #15

Merged
merged 1 commit into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions extractor/osen.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from gallery_dl import exception, text
from gallery_dl.extractor.common import Extractor, Message

BASE_PATTERN = r"(?:https?://)?www\.osen\.co\.kr"
BASE_PATTERN = r"(?:https?://)?(?:www\.)?osen\.co\.kr"


class OsenExtractor(Extractor):
Expand Down Expand Up @@ -40,7 +40,7 @@ class OsenArticleExtractor(OsenExtractor):
directory_fmt = ("{category}", "{article_id}")
archive_fmt = "{article_id}_{filename}_{num}"
pattern = BASE_PATTERN + r"/article/(G\d+)"
example = "https://www.osen.co.kr//article/G12345678910"
example = "https://www.osen.co.kr/article/G12345678910"

def __init__(self, match):
OsenExtractor.__init__(self, match)
Expand Down
9 changes: 9 additions & 0 deletions test/results/osen.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,13 @@
"title": "(여자)아이들 미연 '사랑스럽게'",
"date": "dt:2024-04-18 16:32:00",
},
{
"#url": "https://osen.co.kr/article/G1112452170",
"#category": ("", "osen", "article"),
"#class": osen.OsenArticleExtractor,
"#pattern": IMAGE_URL_PATTERN,
"#count": 1,
"title": "에스타 윈터, 미소와 함께 퇴장",
"date": "dt:2024-11-06 11:38:00",
},
)