This commit is contained in:
parent
c067f1c9ae
commit
77c64df35b
|
@ -408,6 +408,7 @@ WELL_KNOWN_MASTODON_INSTANCES: frozenset[str] = frozenset(
|
|||
|
||||
DISALLOWED_IDENTIFIERS: frozenset[str] = frozenset({'www'})
|
||||
|
||||
|
||||
def determine_social_from_url_internally(
|
||||
url: str,
|
||||
) -> tuple[SocialSiteId | None, str | None]:
|
||||
|
|
|
@ -7,10 +7,18 @@ PARSABLE_SOCIAL_IDS_COMBINED = [
|
|||
('https://triviallytrue.tumblr.com/', SocialSiteId.TUMBLR, 'triviallytrue'),
|
||||
('https://tumblr.com/triviallytrue', SocialSiteId.TUMBLR, 'triviallytrue'),
|
||||
('https://tumblr.com/blog/triviallytrue', SocialSiteId.TUMBLR, 'triviallytrue'),
|
||||
('https://tumblr.com/blog/view/triviallytrue', SocialSiteId.TUMBLR, 'triviallytrue'),
|
||||
(
|
||||
'https://tumblr.com/blog/view/triviallytrue',
|
||||
SocialSiteId.TUMBLR,
|
||||
'triviallytrue',
|
||||
),
|
||||
('https://www.tumblr.com/triviallytrue', SocialSiteId.TUMBLR, 'triviallytrue'),
|
||||
('https://www.tumblr.com/blog/triviallytrue', SocialSiteId.TUMBLR, 'triviallytrue'),
|
||||
('https://www.tumblr.com/blog/view/triviallytrue', SocialSiteId.TUMBLR, 'triviallytrue'),
|
||||
(
|
||||
'https://www.tumblr.com/blog/view/triviallytrue',
|
||||
SocialSiteId.TUMBLR,
|
||||
'triviallytrue',
|
||||
),
|
||||
]
|
||||
|
||||
PARSABLE_SOCIAL_IDS = [
|
||||
|
@ -24,7 +32,7 @@ PARSABLE_SOCIAL_IDS = [
|
|||
('https://www.tiktok.com/@depthsofwikipedia?lang=en', 'depthsofwikipedia'),
|
||||
('https://www.pixiv.net/users/14866303', '14866303'),
|
||||
('https://www.pixiv.net/member.php?id=109710', '109710'),
|
||||
] + [(a,c) for (a,b,c) in PARSABLE_SOCIAL_IDS_COMBINED]
|
||||
] + [(a, c) for (a, b, c) in PARSABLE_SOCIAL_IDS_COMBINED]
|
||||
|
||||
PARSABLE_SOCIAL_SITE_IDS = [
|
||||
('https://www.deviantart.com/solquiet', SocialSiteId.DEVIANT_ART_ACCOUNT),
|
||||
|
@ -36,7 +44,8 @@ PARSABLE_SOCIAL_SITE_IDS = [
|
|||
('https://www.instagram.com/timkongart/', SocialSiteId.INSTAGRAM_PAGE),
|
||||
('https://www.instagram.com/kcn.wu/', SocialSiteId.INSTAGRAM_PAGE),
|
||||
('https://www.instagram.com/itsbettyjiang', SocialSiteId.INSTAGRAM_PAGE),
|
||||
] + [(a,b) for (a,b,c) in PARSABLE_SOCIAL_IDS_COMBINED]
|
||||
] + [(a, b) for (a, b, c) in PARSABLE_SOCIAL_IDS_COMBINED]
|
||||
|
||||
|
||||
@pytest.mark.parametrize('url,expected_social_id', PARSABLE_SOCIAL_IDS)
|
||||
def test_parse_social_ids(url, expected_social_id):
|
||||
|
|
Loading…
Reference in New Issue
Block a user