Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
mikf
GitHub Repository: mikf/gallery-dl
Path: blob/master/test/results/arcalive.py
8885 views
1
# -*- coding: utf-8 -*-
2
3
# This program is free software; you can redistribute it and/or modify
4
# it under the terms of the GNU General Public License version 2 as
5
# published by the Free Software Foundation.
6
7
from gallery_dl.extractor import arcalive
8
9
10
__tests__ = (
11
{
12
"#url" : "https://arca.live/b/arknights/66031722?p=1",
13
"#class" : arcalive.ArcalivePostExtractor,
14
"#pattern": r"https://ac.namu.la/20221225sac2/e06dcf8edd29c597240898a6752c74dbdd0680fc932cfd0ecc898795f1db34b5.jpg\?type=orig&expires=\d+&key=\w+",
15
"#count" : 1,
16
17
"isEditable": False,
18
"isDeletable": False,
19
"isReportable": False,
20
"id": 66031722,
21
"nickname": "Si리링",
22
"title": "엑샤 스작함",
23
"contentType": "html",
24
"content": r"re:^<p>알게또 뽑으려했는데 못뽑아서 엑샤 스작함<br />엑샤에 보카디 3스나 와파린 2스 붙이는거 맞음.+/></p>$",
25
"viewCount": range(8000, 20000),
26
"ratingUp": 0,
27
"ratingDown": 0,
28
"ratingUpIp": 0,
29
"ratingDownIp": 0,
30
"createdAt": "2022-12-25T05:16:55.000Z",
31
"updatedAt": "2022-12-25T05:16:55.000Z",
32
"lastComment": "2022-12-25T05:22:12.000Z",
33
"commentCount": range(2, 9),
34
"publicId": None,
35
"token": "44bb2dfd0bbc672e",
36
"isUser": True,
37
"gravatar": "//secure.gravatar.com/avatar/6c3fdbdeea149b29eea8d887c37fc119?d=retro&f=y",
38
"preventDelete": False,
39
"channelPermission": dict,
40
"captcha": True,
41
"isSensitive": False,
42
"categoryDisplayName": None,
43
"blockPreview": False,
44
"isSpoilerAlert": False,
45
"boardName": "명일방주 채널",
46
"boardSlug": "arknights",
47
"isBest": False,
48
"vote": [],
49
"date": "dt:2022-12-25 05:16:55",
50
"post_url": "https://arca.live/b/arknights/66031722",
51
"count": 1,
52
"num": 1,
53
"url": str,
54
"width": 3200,
55
"height": 1440,
56
"filename": "e06dcf8edd29c597240898a6752c74dbdd0680fc932cfd0ecc898795f1db34b5",
57
"extension": "jpg",
58
},
59
60
{
61
"#url" : "https://arca.live/b/breaking/66031722",
62
"#comment": "/b/breaking page URL",
63
"#class" : arcalive.ArcalivePostExtractor,
64
"#pattern": r"https://ac.namu.la/20221225sac2/e06dcf8edd29c597240898a6752c74dbdd0680fc932cfd0ecc898795f1db34b5.jpg\?type=orig",
65
},
66
67
{
68
"#url" : "https://arca.live/b/bluearchive/65031202",
69
"#comment": "animated gif",
70
"#class" : arcalive.ArcalivePostExtractor,
71
"#pattern": (
72
r"https://ac.namu.la/20221211sac/5ea7fbca5e49ec16beb099fc6fc991690d37552e599b1de8462533908346241e.png\?type=orig",
73
r"https://ac.namu.la/20221211sac/7f73beefc4f18a2f986bc4c6821caba706e27f4c94cb828fc16e2af1253402d9.gif\?type=orig",
74
r"https://ac.namu.la/20221211sac2/3e72f9e05ca97c0c3c0fe5f25632b06eb21ab9f211e9ea22816e16468ee241ca.png\?type=orig",
75
),
76
},
77
78
{
79
"#url" : "https://arca.live/b/arknights/122263340",
80
"#comment": "animated webp",
81
"#class" : arcalive.ArcalivePostExtractor,
82
"#pattern": (
83
r"https://ac.namu.la/20241126sac/b2175d9ef4504945d3d989526120dbb6aded501ddedfba8ecc44a64e7aae9059.gif\?type=orig",
84
r"https://ac.namu.la/20241126sac/bc1f3cb388a3a2d099ab67bc09b28f0a93c2c4755152b3ef9190690a9f0a28fb.webp\?type=orig",
85
),
86
},
87
88
{
89
"#url" : "https://arca.live/b/bluearchive/117240135",
90
"#comment": ".mp4 video",
91
"#class" : arcalive.ArcalivePostExtractor,
92
"#options": {"gifs": "check"},
93
"#pattern": r"https://ac.namu.la/20240926sac/16f07778a97f91b935c8a3394ead01a223d96b2a619fdb25c4628ddba88b5fad.mp4\?type=orig",
94
},
95
96
{
97
"#url" : "https://arca.live/b/bluearchive/111191955",
98
"#comment": "fake .mp4 GIF",
99
"#class" : arcalive.ArcalivePostExtractor,
100
"#options": {"gifs": True},
101
"#pattern": r"https://ac.namu.la/20240714sac/c8fcadeb0b578e5121eb7a7e8fb05984cb87c68e7a6e0481a1c8869bf0ecfd2b.gif\?type=orig",
102
103
"_fallback": "len:tuple:1",
104
},
105
106
{
107
"#url" : "https://arca.live/b/bluearchive/111191955",
108
"#comment": "fake .mp4 GIF",
109
"#class" : arcalive.ArcalivePostExtractor,
110
"#options": {"gifs": False},
111
"#pattern": r"https://ac.namu.la/20240714sac/c8fcadeb0b578e5121eb7a7e8fb05984cb87c68e7a6e0481a1c8869bf0ecfd2b.mp4\?type=orig",
112
},
113
114
{
115
"#url" : "https://arca.live/b/arknights/49406926",
116
"#comment": "static emoticon",
117
"#class" : arcalive.ArcalivePostExtractor,
118
"#pattern": r"https://ac.namu.la/20220428sac2/41f472adcea674aff75f15f146e81c27032bc4d6c8073bd7c19325bd1c97d335.png\?type=orig",
119
},
120
121
{
122
"#url" : "https://arca.live/b/commission/63658702",
123
"#comment": "animated emoticon",
124
"#class" : arcalive.ArcalivePostExtractor,
125
"#options": {"emoticons": True},
126
"#pattern": (
127
r"https://ac.namu.la/20221123sac2/14925c5e22ab9f17f2923ae60a39b7af0794c43e478ecaba054ab6131e57e022.png\?type=orig",
128
r"https://ac.namu.la/20221123sac2/50c385a4004bca44271a2f6133990f086cfefd29a7968514e9c14d6017d61265.png\?type=orig",
129
r"https://ac.namu.la/20221005sac2/28ebe073fffbb2b88f710c2d380b0fe6dd99a856070c4a836db57634a5371366.gif\?type=orig",
130
),
131
},
132
133
{
134
"#url" : "https://arca.live/b/arknights",
135
"#class" : arcalive.ArcaliveBoardExtractor,
136
"#pattern": arcalive.ArcalivePostExtractor.pattern,
137
"#range" : "1-100",
138
"#count" : 100,
139
140
"category" : {str, None},
141
"categoryDisplayName": {str, None},
142
"commentCount": int,
143
"createdAt" : str,
144
"id" : int,
145
"isUser" : bool,
146
"?mark" : str,
147
"nickname" : str,
148
"publicId" : {int, None},
149
"ratingDown" : int,
150
"ratingUp" : int,
151
"thumbnailUrl": {str, None},
152
"title" : str,
153
"viewCount" : int,
154
},
155
156
{
157
"#url" : "https://arca.live/u/@Si%EB%A6%AC%EB%A7%81",
158
"#class": arcalive.ArcaliveUserExtractor,
159
"#range": "1-5",
160
"#results": (
161
"https://arca.live/b/vrchat/107257886",
162
"https://arca.live/b/soulworkers/95371697",
163
"https://arca.live/b/arcalivebreverse/90843346",
164
"https://arca.live/b/arcalivebreverse/90841126",
165
"https://arca.live/b/arcalivebreverse/90769916",
166
),
167
168
"boardName" : str,
169
"boardSlug" : {"vrchat", "soulworkers", "arcalivebreverse"},
170
"category" : {str, None},
171
"categoryDisplayName": {str, None},
172
"commentCount": int,
173
"createdAt" : str,
174
"id" : int,
175
"isUser" : True,
176
"?mark" : "image",
177
"nickname" : "Si리링",
178
"publicId" : {int, None},
179
"ratingDown" : int,
180
"ratingUp" : int,
181
"thumbnailUrl": {str, None},
182
"title" : str,
183
"viewCount" : int,
184
},
185
186
)
187
188