parsehub 2.4.1__tar.gz → 2.4.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {parsehub-2.4.1/src/parsehub.egg-info → parsehub-2.4.3}/PKG-INFO +2 -1
- {parsehub-2.4.1 → parsehub-2.4.3}/README.md +1 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/pyproject.toml +1 -1
- {parsehub-2.4.1 → parsehub-2.4.3}/src/parsehub/parsers/parser/__init__.py +1 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/src/parsehub/parsers/parser/bilibili.py +31 -2
- parsehub-2.4.3/src/parsehub/parsers/parser/jandan.py +35 -0
- parsehub-2.4.3/src/parsehub/provider_api/jandan.py +104 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/src/parsehub/types/platform.py +1 -0
- {parsehub-2.4.1 → parsehub-2.4.3/src/parsehub.egg-info}/PKG-INFO +2 -1
- {parsehub-2.4.1 → parsehub-2.4.3}/src/parsehub.egg-info/SOURCES.txt +2 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/test/test_core_offline.py +14 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/LICENSE +0 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/setup.cfg +0 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/src/__init__.py +0 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/src/parsehub/__init__.py +0 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/src/parsehub/cli.py +0 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/src/parsehub/cli_config.py +0 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/src/parsehub/config/__init__.py +0 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/src/parsehub/config/config.py +0 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/src/parsehub/errors.py +0 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/src/parsehub/parsers/__init__.py +0 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/src/parsehub/parsers/base/__init__.py +0 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/src/parsehub/parsers/base/base.py +0 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/src/parsehub/parsers/base/ytdlp.py +0 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/src/parsehub/parsers/parser/bangumi.py +0 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/src/parsehub/parsers/parser/coolapk.py +0 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/src/parsehub/parsers/parser/douban.py +0 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/src/parsehub/parsers/parser/douyin.py +0 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/src/parsehub/parsers/parser/facebook.py +0 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/src/parsehub/parsers/parser/instagram.py +0 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/src/parsehub/parsers/parser/kuaishou.py +0 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/src/parsehub/parsers/parser/medium.py +0 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/src/parsehub/parsers/parser/pipix.py +0 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/src/parsehub/parsers/parser/snapchat.py +0 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/src/parsehub/parsers/parser/threads.py +0 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/src/parsehub/parsers/parser/tieba.py +0 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/src/parsehub/parsers/parser/tiktok.py +0 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/src/parsehub/parsers/parser/toutiao.py +0 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/src/parsehub/parsers/parser/twitter.py +0 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/src/parsehub/parsers/parser/weibo.py +0 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/src/parsehub/parsers/parser/weixin.py +0 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/src/parsehub/parsers/parser/wxchannels.py +0 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/src/parsehub/parsers/parser/xhs.py +0 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/src/parsehub/parsers/parser/xiaoheihe.py +0 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/src/parsehub/parsers/parser/youtube.py +0 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/src/parsehub/parsers/parser/zhihu.py +0 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/src/parsehub/parsers/parser/zuiyou.py +0 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/src/parsehub/provider_api/__init__.py +0 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/src/parsehub/provider_api/bangumi.py +0 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/src/parsehub/provider_api/bilibili.py +0 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/src/parsehub/provider_api/coolapk.py +0 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/src/parsehub/provider_api/douban.py +0 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/src/parsehub/provider_api/douyin.py +0 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/src/parsehub/provider_api/instagram.py +0 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/src/parsehub/provider_api/kuaishou.py +0 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/src/parsehub/provider_api/medium.py +0 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/src/parsehub/provider_api/pipix.py +0 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/src/parsehub/provider_api/threads.py +0 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/src/parsehub/provider_api/tieba.py +0 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/src/parsehub/provider_api/tiktok.py +0 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/src/parsehub/provider_api/toutiao.py +0 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/src/parsehub/provider_api/twitter.py +0 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/src/parsehub/provider_api/weibo.py +0 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/src/parsehub/provider_api/weixin.py +0 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/src/parsehub/provider_api/wxchannels.py +0 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/src/parsehub/provider_api/xhs.py +0 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/src/parsehub/provider_api/xiaoheihe.py +0 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/src/parsehub/provider_api/zhihu.py +0 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/src/parsehub/provider_api/zuiyou.py +0 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/src/parsehub/types/__init__.py +0 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/src/parsehub/types/callback.py +0 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/src/parsehub/types/media_file.py +0 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/src/parsehub/types/media_ref.py +0 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/src/parsehub/types/post.py +0 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/src/parsehub/types/result.py +0 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/src/parsehub/utils/downloader.py +0 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/src/parsehub/utils/fallback.py +0 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/src/parsehub/utils/helpers.py +0 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/src/parsehub/utils/media_info.py +0 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/src/parsehub.egg-info/dependency_links.txt +0 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/src/parsehub.egg-info/entry_points.txt +0 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/src/parsehub.egg-info/requires.txt +0 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/src/parsehub.egg-info/top_level.txt +0 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/test/test_cli.py +0 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/test/test_cli_config.py +0 -0
- {parsehub-2.4.1 → parsehub-2.4.3}/test/test_downloader.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: parsehub
|
|
3
|
-
Version: 2.4.
|
|
3
|
+
Version: 2.4.3
|
|
4
4
|
Summary: 轻量、异步、开箱即用的社交媒体聚合解析库
|
|
5
5
|
Author-email: 梓澪 <zilingmio@gmail.com>
|
|
6
6
|
License: MIT
|
|
@@ -101,6 +101,7 @@ Dynamic: license-file
|
|
|
101
101
|
| **Bangumi** | | ✅ | 💬 条目讨论, 日志, 小组话题 |
|
|
102
102
|
| **今日头条** | ✅ | ✅ | 📰 文章, 微头条 |
|
|
103
103
|
| **Medium** | ✅ | ✅ | 📰 文章 |
|
|
104
|
+
| **煎蛋** | | ✅ | 📰 文章, 💬 话题 |
|
|
104
105
|
|
|
105
106
|
## 📦 安装
|
|
106
107
|
|
|
@@ -24,17 +24,30 @@ from ...utils.helpers import UA
|
|
|
24
24
|
from ..base.base import BaseParser, FallbackStage
|
|
25
25
|
from ..base.ytdlp import YtParser, YtVideoParseResult
|
|
26
26
|
|
|
27
|
+
_INTL_HOSTS = ("bilibili.tv",)
|
|
28
|
+
_BILI_COM_HOSTS = ("www.bilibili.com", "m.bilibili.com", "t.bilibili.com")
|
|
29
|
+
# 语言前缀理论上覆盖 ISO 639-1 / BCP 47: 2-3 位语言码 + 可选 2-4 位后缀 (如 en、ja、zh-Hans)
|
|
30
|
+
_LOCALE_PREFIX = re.compile(r"^/[a-zA-Z]{2,3}(?:-[a-zA-Z]{2,4})?/(?=(?:video|opus|audio)/)")
|
|
31
|
+
|
|
27
32
|
|
|
28
33
|
class BiliParse(BaseParser):
|
|
29
34
|
__platform__ = Platform.BILIBILI
|
|
30
35
|
__supported_type__ = ["视频", "动态", "音乐"]
|
|
31
|
-
__match__ =
|
|
36
|
+
__match__ = (
|
|
37
|
+
r"^(http(s)?://)?("
|
|
38
|
+
r"(www\.|m\.|t\.)?bilibili\.com/([a-zA-Z]{2,3}(?:-[a-zA-Z]{2,4})?/)?(video|opus|audio/au\d+|\b\d{18,19}\b)"
|
|
39
|
+
r"|(www\.|m\.)?bilibili\.tv/([a-zA-Z]{2}/)?(play/\d+/\d+|video/\d+)"
|
|
40
|
+
r"|b23\.tv|bili2233\.cn"
|
|
41
|
+
r").*"
|
|
42
|
+
)
|
|
32
43
|
__reserved_parameters__ = ["p"]
|
|
33
44
|
__redirect_keywords__ = ["b23.tv", "bili2233.cn"]
|
|
34
45
|
|
|
35
46
|
async def _do_parse(
|
|
36
47
|
self, raw_url: str
|
|
37
48
|
) -> YtVideoParseResult | BiliVideoParseResult | BiliMusicParseResult | ImageParseResult:
|
|
49
|
+
if self.is_intl_url(raw_url):
|
|
50
|
+
return await self.ytp_parse(raw_url)
|
|
38
51
|
parsed = urlparse(raw_url)
|
|
39
52
|
if parsed.hostname == "mall.bilibili.com":
|
|
40
53
|
raise ParseError("不支持解析商品")
|
|
@@ -64,6 +77,12 @@ class BiliParse(BaseParser):
|
|
|
64
77
|
stop=lambda e: False,
|
|
65
78
|
)
|
|
66
79
|
|
|
80
|
+
@staticmethod
|
|
81
|
+
def is_intl_url(url: str) -> bool:
|
|
82
|
+
"""是否哔哩哔哩国际版链接"""
|
|
83
|
+
hostname = (urlparse(url).hostname or "").lower()
|
|
84
|
+
return any(hostname == host or hostname.endswith(f".{host}") for host in _INTL_HOSTS)
|
|
85
|
+
|
|
67
86
|
@staticmethod
|
|
68
87
|
def _is_bvid(url: str) -> bool:
|
|
69
88
|
if url.lower().startswith("bv"):
|
|
@@ -85,6 +104,8 @@ class BiliParse(BaseParser):
|
|
|
85
104
|
else:
|
|
86
105
|
raw_url = await super().get_raw_url(url, **kwargs)
|
|
87
106
|
u = urlparse(raw_url)
|
|
107
|
+
if (u.hostname or "").lower() == "m.bilibili.tv":
|
|
108
|
+
u = u._replace(netloc="www.bilibili.tv")
|
|
88
109
|
q = urlencode([(k, v) for k, v in parse_qsl(u.query) if (k, v) != ("p", "1")])
|
|
89
110
|
return u._replace(query=q).geturl()
|
|
90
111
|
|
|
@@ -179,7 +200,15 @@ class BiliParse(BaseParser):
|
|
|
179
200
|
return suffix.removeprefix(".") or "m4a"
|
|
180
201
|
|
|
181
202
|
async def ytp_parse(self, url: str) -> YtVideoParseResult:
|
|
182
|
-
return await BiliYtParse(proxy=self.proxy, cookie=self.cookie)._do_parse(url)
|
|
203
|
+
return await BiliYtParse(proxy=self.proxy, cookie=self.cookie)._do_parse(self._yt_dlp_url(url))
|
|
204
|
+
|
|
205
|
+
@staticmethod
|
|
206
|
+
def _yt_dlp_url(url: str) -> str:
|
|
207
|
+
"""yt-dlp 只认国内站路径, 语言前缀页面 (如 /en/video/...) 需去掉前缀"""
|
|
208
|
+
u = urlparse(url)
|
|
209
|
+
if (u.hostname or "").lower() in _BILI_COM_HOSTS:
|
|
210
|
+
u = u._replace(path=_LOCALE_PREFIX.sub("/", u.path, count=1))
|
|
211
|
+
return u.geturl()
|
|
183
212
|
|
|
184
213
|
@staticmethod
|
|
185
214
|
def change_source(url: str) -> str:
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
from pathlib import PurePosixPath
|
|
2
|
+
from urllib.parse import urlsplit
|
|
3
|
+
|
|
4
|
+
from ...provider_api.jandan import Jandan, JandanError
|
|
5
|
+
from ...types import AniRef, ImageRef, ParseError, Platform, RichTextParseResult
|
|
6
|
+
from ..base.base import BaseParser
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class JandanParser(BaseParser):
|
|
10
|
+
__platform__ = Platform.JANDAN
|
|
11
|
+
__supported_type__ = ["图文"]
|
|
12
|
+
__match__ = r"^(http(s)?://)?jandan\.net/(t|p)/\d+"
|
|
13
|
+
|
|
14
|
+
@staticmethod
|
|
15
|
+
def _ref(url: str) -> ImageRef | AniRef:
|
|
16
|
+
"""正文里的动图也是 <img>; 扩展名取自 URL."""
|
|
17
|
+
suffix = PurePosixPath(urlsplit(url).path).suffix.lstrip(".").lower()
|
|
18
|
+
if suffix == "gif":
|
|
19
|
+
return AniRef(url=url)
|
|
20
|
+
return ImageRef(url=url, ext=suffix) if suffix else ImageRef(url=url)
|
|
21
|
+
|
|
22
|
+
async def _do_parse(self, raw_url: str) -> RichTextParseResult:
|
|
23
|
+
try:
|
|
24
|
+
post = await Jandan(proxy=self.proxy).parse(raw_url)
|
|
25
|
+
except JandanError as e:
|
|
26
|
+
raise ParseError(f"煎蛋解析失败: {e}") from e
|
|
27
|
+
|
|
28
|
+
return RichTextParseResult(
|
|
29
|
+
title=post.title,
|
|
30
|
+
media=[self._ref(url) for url in post.images],
|
|
31
|
+
markdown_content=post.markdown_content,
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
__all__ = ["JandanParser"]
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import re
|
|
4
|
+
from dataclasses import dataclass, field
|
|
5
|
+
from typing import Any
|
|
6
|
+
from urllib.parse import urljoin
|
|
7
|
+
|
|
8
|
+
import httpx
|
|
9
|
+
from bs4 import BeautifulSoup
|
|
10
|
+
from markdownify import MarkdownConverter
|
|
11
|
+
|
|
12
|
+
from ..errors import ContentUnavailableError
|
|
13
|
+
from ..utils.helpers import UA
|
|
14
|
+
|
|
15
|
+
_POST_NO_RE = re.compile(r"No\.\s*\d+")
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
@dataclass
|
|
19
|
+
class JandanPost:
|
|
20
|
+
"""煎蛋帖子的解析结果
|
|
21
|
+
|
|
22
|
+
Attributes:
|
|
23
|
+
title: 标题
|
|
24
|
+
markdown_content: markdown 正文
|
|
25
|
+
images: 正文内的图片地址
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
title: str
|
|
29
|
+
markdown_content: str
|
|
30
|
+
images: list[str] = field(default_factory=list)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class Jandan:
|
|
34
|
+
def __init__(self, proxy: str | None = None):
|
|
35
|
+
self.proxy = proxy
|
|
36
|
+
|
|
37
|
+
async def parse(self, url: str) -> JandanPost:
|
|
38
|
+
async with httpx.AsyncClient(proxy=self.proxy, timeout=30, headers={"User-Agent": UA}) as client:
|
|
39
|
+
response = await client.get(url)
|
|
40
|
+
if response.status_code == 404:
|
|
41
|
+
raise ContentUnavailableError("煎蛋内容不存在或已删除")
|
|
42
|
+
if not 200 <= response.status_code < 300:
|
|
43
|
+
raise JandanError(f"HTTP {response.status_code}")
|
|
44
|
+
return self._parse_html(response.text, str(response.url))
|
|
45
|
+
|
|
46
|
+
@staticmethod
|
|
47
|
+
def _parse_html(html: str, page_url: str) -> JandanPost:
|
|
48
|
+
soup = BeautifulSoup(html, "lxml")
|
|
49
|
+
content = soup.select_one(".post-content")
|
|
50
|
+
if content is None:
|
|
51
|
+
raise JandanError("未找到煎蛋正文")
|
|
52
|
+
|
|
53
|
+
heading = soup.find("h1")
|
|
54
|
+
for a in content.find_all("a", href=True):
|
|
55
|
+
a["href"] = urljoin(page_url, str(a["href"]))
|
|
56
|
+
converter = _JandanMarkdownConverter(page_url)
|
|
57
|
+
markdown_content = converter.convert(str(content)).strip()
|
|
58
|
+
return JandanPost(
|
|
59
|
+
title=_compose_title(
|
|
60
|
+
heading.get_text(strip=True) if heading else "",
|
|
61
|
+
_first_line(content.get_text("\n", strip=True)),
|
|
62
|
+
),
|
|
63
|
+
markdown_content=markdown_content,
|
|
64
|
+
images=converter.images,
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
def _first_line(text: str, limit: int = 80) -> str:
|
|
69
|
+
line = next((line for line in text.splitlines() if line.strip()), "")
|
|
70
|
+
return " ".join(line.split())[:limit]
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
def _compose_title(heading: str, first_line: str) -> str:
|
|
74
|
+
"""话题帖的标题只是 "No.6209188", 这时用正文首行代替."""
|
|
75
|
+
heading = " ".join(heading.split())
|
|
76
|
+
if heading and not _POST_NO_RE.fullmatch(heading):
|
|
77
|
+
return heading
|
|
78
|
+
return first_line or heading
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
class _JandanMarkdownConverter(MarkdownConverter):
|
|
82
|
+
"""把正文 HTML 转为 markdown 并收集图片地址."""
|
|
83
|
+
|
|
84
|
+
def __init__(self, page_url: str) -> None:
|
|
85
|
+
super().__init__(heading_style="ATX")
|
|
86
|
+
self.page_url = page_url
|
|
87
|
+
self.images: list[str] = []
|
|
88
|
+
|
|
89
|
+
def convert_img(self, el: Any, text: Any, parent_tags: Any) -> str:
|
|
90
|
+
alt = el.attrs.get("alt") or ""
|
|
91
|
+
source = el.attrs.get("src") or ""
|
|
92
|
+
url = urljoin(self.page_url, source) if source else ""
|
|
93
|
+
if not url:
|
|
94
|
+
return alt
|
|
95
|
+
if url not in self.images:
|
|
96
|
+
self.images.append(url)
|
|
97
|
+
return f""
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
class JandanError(Exception):
|
|
101
|
+
pass
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
__all__ = ["Jandan", "JandanError", "JandanPost"]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: parsehub
|
|
3
|
-
Version: 2.4.
|
|
3
|
+
Version: 2.4.3
|
|
4
4
|
Summary: 轻量、异步、开箱即用的社交媒体聚合解析库
|
|
5
5
|
Author-email: 梓澪 <zilingmio@gmail.com>
|
|
6
6
|
License: MIT
|
|
@@ -101,6 +101,7 @@ Dynamic: license-file
|
|
|
101
101
|
| **Bangumi** | | ✅ | 💬 条目讨论, 日志, 小组话题 |
|
|
102
102
|
| **今日头条** | ✅ | ✅ | 📰 文章, 微头条 |
|
|
103
103
|
| **Medium** | ✅ | ✅ | 📰 文章 |
|
|
104
|
+
| **煎蛋** | | ✅ | 📰 文章, 💬 话题 |
|
|
104
105
|
|
|
105
106
|
## 📦 安装
|
|
106
107
|
|
|
@@ -26,6 +26,7 @@ src/parsehub/parsers/parser/douban.py
|
|
|
26
26
|
src/parsehub/parsers/parser/douyin.py
|
|
27
27
|
src/parsehub/parsers/parser/facebook.py
|
|
28
28
|
src/parsehub/parsers/parser/instagram.py
|
|
29
|
+
src/parsehub/parsers/parser/jandan.py
|
|
29
30
|
src/parsehub/parsers/parser/kuaishou.py
|
|
30
31
|
src/parsehub/parsers/parser/medium.py
|
|
31
32
|
src/parsehub/parsers/parser/pipix.py
|
|
@@ -50,6 +51,7 @@ src/parsehub/provider_api/coolapk.py
|
|
|
50
51
|
src/parsehub/provider_api/douban.py
|
|
51
52
|
src/parsehub/provider_api/douyin.py
|
|
52
53
|
src/parsehub/provider_api/instagram.py
|
|
54
|
+
src/parsehub/provider_api/jandan.py
|
|
53
55
|
src/parsehub/provider_api/kuaishou.py
|
|
54
56
|
src/parsehub/provider_api/medium.py
|
|
55
57
|
src/parsehub/provider_api/pipix.py
|
|
@@ -225,6 +225,14 @@ class TestPlatformUrlMatching(unittest.TestCase):
|
|
|
225
225
|
"https://m.bilibili.com/audio/au2854883",
|
|
226
226
|
"https://b23.tv/abc123",
|
|
227
227
|
"https://bili2233.cn/abc123",
|
|
228
|
+
"https://www.bilibili.tv/en/video/2045730385",
|
|
229
|
+
"https://bilibili.tv/video/2019955076",
|
|
230
|
+
"https://www.bilibili.tv/EN/video/2019955076",
|
|
231
|
+
"https://m.bilibili.tv/en/video/2045730385",
|
|
232
|
+
"https://www.bilibili.tv/en/play/34613/341736",
|
|
233
|
+
"https://www.bilibili.com/en/video/BV15Gsj6iEaz/",
|
|
234
|
+
"https://www.bilibili.com/ja/video/BV15Gsj6iEaz/",
|
|
235
|
+
"https://www.bilibili.com/zh-Hans/video/BV15Gsj6iEaz/",
|
|
228
236
|
],
|
|
229
237
|
Platform.COOLAPK: [
|
|
230
238
|
"https://www.coolapk.com/feed/70163953",
|
|
@@ -259,6 +267,12 @@ class TestPlatformUrlMatching(unittest.TestCase):
|
|
|
259
267
|
"https://www.instagram.com/user.name/reel/C0example/",
|
|
260
268
|
"https://www.instagram.com/reels/DaGI8bPS3ed/",
|
|
261
269
|
],
|
|
270
|
+
Platform.JANDAN: [
|
|
271
|
+
"https://jandan.net/t/6209188",
|
|
272
|
+
"https://jandan.net/t/6209188#comments",
|
|
273
|
+
"https://jandan.net/p/124273",
|
|
274
|
+
"jandan.net/p/124273/",
|
|
275
|
+
],
|
|
262
276
|
Platform.KUAISHOU: [
|
|
263
277
|
"https://www.kuaishou.com/short-video/3xexample",
|
|
264
278
|
"https://v.kuaishou.com/example",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|