[deviantart] add 'avatar' and 'background' extractors (#4995)

This commit is contained in:
Mike Fährmann
2024-01-02 23:45:59 +01:00
parent ee65f3de43
commit 4f3671458e
4 changed files with 154 additions and 12 deletions

View File

@@ -14,7 +14,7 @@ __tests__ = (
"#url" : "https://www.deviantart.com/shimoda7",
"#category": ("", "deviantart", "user"),
"#class" : deviantart.DeviantartUserExtractor,
"#pattern" : "/shimoda7/gallery$",
"#urls" : "https://www.deviantart.com/shimoda7/gallery",
},
{
@@ -22,8 +22,15 @@ __tests__ = (
"#category": ("", "deviantart", "user"),
"#class" : deviantart.DeviantartUserExtractor,
"#options" : {"include": "all"},
"#pattern" : "/shimoda7/(gallery(/scraps)?|posts(/statuses)?|favourites)$",
"#count" : 5,
"#urls" : (
"https://www.deviantart.com/shimoda7/avatar",
"https://www.deviantart.com/shimoda7/banner",
"https://www.deviantart.com/shimoda7/gallery",
"https://www.deviantart.com/shimoda7/gallery/scraps",
"https://www.deviantart.com/shimoda7/posts",
"https://www.deviantart.com/shimoda7/posts/statuses",
"https://www.deviantart.com/shimoda7/favourites",
),
},
{
@@ -195,6 +202,93 @@ __tests__ = (
"#class" : deviantart.DeviantartGalleryExtractor,
},
{
"#url" : "https://deviantart.com/shimoda7/avatar",
"#category": ("", "deviantart", "avatar"),
"#class" : deviantart.DeviantartAvatarExtractor,
"#urls" : "https://a.deviantart.net/avatars-big/s/h/shimoda7.jpg?4",
"#sha1_content": "abf2cc79b842315f2e54bfdd93bf794a0f612b6f",
"author" : {
"type" : "premium",
"usericon": "https://a.deviantart.net/avatars/s/h/shimoda7.jpg?4",
"userid" : "9AE51FC7-0278-806C-3FFF-F4961ABF9E2B",
"username": "shimoda7",
},
"content" : {
"src": "https://a.deviantart.net/avatars-big/s/h/shimoda7.jpg?4"
},
"da_category" : "avatar",
"date" : "dt:1970-01-01 00:00:00",
"extension" : "jpg",
"filename" : "avatar_by_shimoda7-d4",
"index" : 4,
"index_base36" : "4",
"is_deleted" : False,
"is_downloadable": False,
"is_original" : True,
"published_time" : 0,
"target" : {
"extension": "jpg",
"filename" : "avatar_by_shimoda7-d4",
"src" : "https://a.deviantart.net/avatars-big/s/h/shimoda7.jpg?4"
},
"title" : "avatar",
"username" : "shimoda7",
},
{
"#url" : "https://deviantart.com/gdldev/banner",
"#category": ("", "deviantart", "background"),
"#class" : deviantart.DeviantartBackgroundExtractor,
"#pattern" : r"https://wixmp-\w+\.wixmp\.com/f/b042e0ae-a7ff-420b-a41a-b35503427360/dgntyqc-3deebb65-04b4-4085-992a-aa0c0e7e225d\.png\?token=ey[\w.-]+$",
"#sha1_content": "980eaa76ce515f1b6bef60dfadf26a5bbe9c583f",
"allows_comments" : True,
"author" : {
"type" : "regular",
"usericon": "https://a.deviantart.net/avatars/g/d/gdldev.jpg?2",
"userid" : "1A12BA26-33C2-AA0A-7678-0B6DFBA7AC8E",
"username": "gdldev"
},
"category_path" : "",
"content" : {
"filename" : "banner_by_gdldev_dgntyqc.png",
"filesize" : 84510,
"height" : 4000,
"src" : r"re:https://wixmp-\w+\.wixmp\.com/f/b042e0ae-a7ff-420b-a41a-b35503427360/dgntyqc-3deebb65-04b4-4085-992a-aa0c0e7e225d\.png\?token=ey[\w.-]+$",
"transparency": False,
"width" : 6400
},
"da_category" : "Uncategorized",
"date" : "dt:2024-01-02 21:16:06",
"deviationid" : "8C8D6B28-766A-DE21-7F7D-CE055C3BD50A",
"download_filesize": 84510,
"extension" : "png",
"filename" : "banner_by_gdldev-dgntyqc",
"index" : 1007488020,
"index_base36" : "gntyqc",
"is_blocked" : False,
"is_deleted" : False,
"is_downloadable" : True,
"is_favourited" : False,
"is_mature" : False,
"is_original" : True,
"is_published" : False,
"preview" : dict,
"printid" : None,
"published_time" : 1704230166,
"stats" : {
"comments" : 0,
"favourites": 0,
},
"target" : dict,
"thumbs" : list,
"title" : "Banner",
"url" : "https://sta.sh/0198jippkeys",
"username" : "gdldev",
},
{
"#url" : "https://www.deviantart.com/shimoda7/gallery/722019/Miscellaneous",
"#comment" : "user",