1
0

Itch developers

This commit is contained in:
Jon Michael Aanes 2023-12-03 21:33:50 +01:00
parent 70728b70a8
commit 88976fdc3e

View File

@ -41,11 +41,14 @@ class SocialSiteId(enum.Enum):
VIMEO_CHANNEL = 27
NEWGROUNDS_PAGE = 28
ARTSY_ARTIST = 2042
ARTNET_ARTIST = 3782
LINK_COLLECTION_PAGE = 29
DEVIANT_ART_ACCOUNT = 7737
DANBOORU_ARTIST = 30
BANDCAMP_PROFILE = 3283
BLUESKY_PROFILE = 32
ITCH_IO_DEVELOPER = 8176
FIREFOX_PROFILE_BOOKMARKS = 33
def wikidata_property(self, client):
return client.get(WIKIDATA_PROPERTIES[self])
@ -109,10 +112,12 @@ WIKIDATA_PROPERTIES = {
SocialSiteId.VIMEO_CHANNEL: WikidataInfo(4015, 156376),
SocialSiteId.NEWGROUNDS_PAGE: WikidataInfo(None, 263655),
SocialSiteId.ARTSY_ARTIST: WikidataInfo(2042, 4796642),
SocialSiteId.ARTNET_ARTIST: WikidataInfo(3782, 266566),
SocialSiteId.DEVIANT_ART_ACCOUNT: WikidataInfo(7737, None),
SocialSiteId.DANBOORU_ARTIST: WikidataInfo(None, 64514853),
SocialSiteId.BANDCAMP_PROFILE: WikidataInfo(3283, 545966),
SocialSiteId.BLUESKY_PROFILE: WikidataInfo(None, 78194383),
SocialSiteId.ITCH_IO_DEVELOPER: WikidataInfo(8176, 22905933),
}
def re_social_subdomain(main_domain):
@ -143,7 +148,8 @@ MAILTO_URL = r'^mailto:(?:[\w._.]+@[\w._.]+)$'
REDDIT_SUBREDDIT_URL = r'^(?:https?:\/\/)?(?:old\.)?reddit\.com\/r\/([\w-]+)\/?$'
REDDIT_USER_URL = r'^(?:https?:\/\/)?(?:old\.)?reddit\.com\/user\/([\w-]+)(?:|\/submitted)\/?$'
TWITTER_HANDLE_URL =re_social_path('twitter.com')
TWITTER_HANDLE_URL_1 =re_social_path('twitter.com')
TWITTER_HANDLE_URL_2 =re_social_path('x.com')
LINKTREE_PAGE_URL = re_social_path('linktr.ee')
TWITCH_STREAM_URL = re_social_path('twitch.tv')
WIKIDATA_ITEM_URL = re_social_path_adv('wikidata.org', 'wiki', RE_ID)
@ -172,12 +178,14 @@ URL_PARSE_YOUTUBE_CHANNEL_HANDLE_2= re_social_path_adv('youtube.com', 'c', RE_ID
URL_PARSE_YOUTUBE_CHANNEL_ID= re_social_path_adv('youtube.com', 'channel', RE_ID)
URL_PARSE_VIMEO_CHANNEL= re_social_path_adv('vimeo.com', RE_ID)
URL_PARSE_NEWGROUNDS_PAGE = re_social_subdomain('newgrounds.com')
URL_PARSE_ARTSY_ARTIST = re_social_path_adv('artsy.net', 'artist', RE_ID)
URL_PARSE_ARTSY_ARTIST = re_social_path_adv('artsy.net', 'artist', RE_ID, RE_ANY_SUBPATH)
URL_PARSE_ARTNET_ARTIST = re_social_path_adv('artnet.com', 'artists', RE_ID, RE_ANY_SUBPATH)
URL_PARSE_DEVIANT_ART_ACCOUNT = re_social_path_adv('deviantart.com', RE_ID)
URL_PARSE_DEVIANT_ART_ACCOUNT_2 = re_social_subdomain('deviantart.com')
URL_PARSE_DANBOORU_ARTIST = re_social_path_adv('danbooru.donmai.us', 'artists', RE_ID)
URL_PARSE_BANDCAMP = re_social_subdomain('bandcamp.com')
URL_PARSE_BLUESKY = re_social_path_adv('bsky.app', 'profile', RE_ID)
URL_PARSE_ITCH_IO_DEVELOPER = re_social_subdomain('itch.io')
REGEXES = [
# Reddit
@ -185,7 +193,8 @@ REGEXES = [
(REDDIT_USER_URL, SocialSiteId.REDDIT_USER),
# Twitter
(TWITTER_HANDLE_URL, SocialSiteId.TWITTER),
(TWITTER_HANDLE_URL_1, SocialSiteId.TWITTER),
(TWITTER_HANDLE_URL_2, SocialSiteId.TWITTER),
# Facebook
(FACEBOOK_PAGE_URL, SocialSiteId.FACEBOOK_PAGE),
@ -263,6 +272,7 @@ REGEXES = [
# Artsy
(URL_PARSE_ARTSY_ARTIST, SocialSiteId.ARTSY_ARTIST),
(URL_PARSE_ARTNET_ARTIST, SocialSiteId.ARTNET_ARTIST),
# Deviant art
(URL_PARSE_DEVIANT_ART_ACCOUNT, SocialSiteId.DEVIANT_ART_ACCOUNT),
@ -276,13 +286,16 @@ REGEXES = [
# Bluesky
(URL_PARSE_BLUESKY, SocialSiteId.BLUESKY_PROFILE),
# Itch.io
(URL_PARSE_ITCH_IO_DEVELOPER, SocialSiteId.ITCH_IO_DEVELOPER),
]
WELL_KNOWN_MASTODON_INSTANCES = frozenset({
# Includes all servers with 50 000+ users as of 6 july 2023.
# based on https://mastodonservers.net/servers/top
'mastodon.social',
'pawoo.net',
#'pawoo.net',
'baraag.net',
'mstdn.jp',
'mastodon.cloud',