Debian Codegraph @

gallery_dl/extractor/utils/500px_graphql.py

raw
1 # -*- coding: utf-8 -*-
2
3 # Copyright 2026 Mike Fährmann
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License version 2 as
7 # published by the Free Software Foundation.
8
9
10 OtherPhotosQuery = """\
11 query OtherPhotosQuery($username: String!, $pageSize: Int) {
12 user: userByUsername(username: $username) {
13 ...OtherPhotosPaginationContainer_user_RlXb8
14 id
15 }
16 }
17
18 fragment OtherPhotosPaginationContainer_user_RlXb8 on User {
19 photos(first: $pageSize, privacy: PROFILE, sort: ID_DESC) {
20 edges {
21 node {
22 id
23 legacyId
24 canonicalPath
25 width
26 height
27 name
28 isLikedByMe
29 notSafeForWork
30 photographer: uploader {
31 id
32 legacyId
33 username
34 displayName
35 canonicalPath
36 followedByUsers {
37 isFollowedByMe
38 }
39 }
40 images(sizes: [33, 35]) {
41 size
42 url
43 jpegUrl
44 webpUrl
45 id
46 }
47 __typename
48 }
49 cursor
50 }
51 totalCount
52 pageInfo {
53 endCursor
54 hasNextPage
55 }
56 }
57 }
58 """
59
60 OtherPhotosPaginationContainerQuery = """\
61 query OtherPhotosPaginationContainerQuery($username: String!, $pageSize: Int, $cursor: String) {
62 userByUsername(username: $username) {
63 ...OtherPhotosPaginationContainer_user_3e6UuE
64 id
65 }
66 }
67
68 fragment OtherPhotosPaginationContainer_user_3e6UuE on User {
69 photos(first: $pageSize, after: $cursor, privacy: PROFILE, sort: ID_DESC) {
70 edges {
71 node {
72 id
73 legacyId
74 canonicalPath
75 width
76 height
77 name
78 isLikedByMe
79 notSafeForWork
80 photographer: uploader {
81 id
82 legacyId
83 username
84 displayName
85 canonicalPath
86 followedByUsers {
87 isFollowedByMe
88 }
89 }
90 images(sizes: [33, 35]) {
91 size
92 url
93 jpegUrl
94 webpUrl
95 id
96 }
97 __typename
98 }
99 cursor
100 }
101 totalCount
102 pageInfo {
103 endCursor
104 hasNextPage
105 }
106 }
107 }
108 """
109
110 ProfileRendererQuery = """\
111 query ProfileRendererQuery($username: String!) {
112 profile: userByUsername(username: $username) {
113 id
114 legacyId
115 userType: type
116 username
117 firstName
118 displayName
119 registeredAt
120 canonicalPath
121 avatar {
122 ...ProfileAvatar_avatar
123 id
124 }
125 userProfile {
126 firstname
127 lastname
128 state
129 country
130 city
131 about
132 id
133 }
134 socialMedia {
135 website
136 twitter
137 instagram
138 facebook
139 id
140 }
141 coverPhotoUrl
142 followedByUsers {
143 totalCount
144 isFollowedByMe
145 }
146 followingUsers {
147 totalCount
148 }
149 membership {
150 expiryDate
151 membershipTier: tier
152 photoUploadQuota
153 refreshPhotoUploadQuotaAt
154 paymentStatus
155 id
156 }
157 profileTabs {
158 tabs {
159 name
160 visible
161 }
162 }
163 ...EditCover_cover
164 photoStats {
165 likeCount
166 viewCount
167 }
168 photos(privacy: PROFILE) {
169 totalCount
170 }
171 licensingPhotos(status: ACCEPTED) {
172 totalCount
173 }
174 portfolio {
175 id
176 status
177 userDisabled
178 }
179 }
180 }
181
182 fragment EditCover_cover on User {
183 coverPhotoUrl
184 }
185
186 fragment ProfileAvatar_avatar on UserAvatar {
187 images(sizes: [MEDIUM, LARGE]) {
188 size
189 url
190 id
191 }
192 }
193 """
194
195 GalleriesDetailQueryRendererQuery = """\
196 query GalleriesDetailQueryRendererQuery($galleryOwnerLegacyId: ID!, $ownerLegacyId: String, $slug: String, $token: String, $pageSize: Int, $gallerySize: Int) {
197 galleries(galleryOwnerLegacyId: $galleryOwnerLegacyId, first: $gallerySize) {
198 edges {
199 node {
200 legacyId
201 description
202 name
203 privacy
204 canonicalPath
205 notSafeForWork
206 buttonName
207 externalUrl
208 cover {
209 images(sizes: [35, 33]) {
210 size
211 webpUrl
212 jpegUrl
213 id
214 }
215 id
216 }
217 photos {
218 totalCount
219 }
220 id
221 }
222 }
223 }
224 gallery: galleryByOwnerIdAndSlugOrToken(ownerLegacyId: $ownerLegacyId, slug: $slug, token: $token) {
225 ...GalleriesDetailPaginationContainer_gallery_RlXb8
226 id
227 }
228 }
229
230 fragment GalleriesDetailPaginationContainer_gallery_RlXb8 on Gallery {
231 id
232 legacyId
233 name
234 privacy
235 notSafeForWork
236 ownPhotosOnly
237 canonicalPath
238 publicSlug
239 lastPublishedAt
240 photosAddedSinceLastPublished
241 reportStatus
242 creator {
243 legacyId
244 id
245 }
246 cover {
247 images(sizes: [33, 32, 36, 2048]) {
248 url
249 size
250 webpUrl
251 id
252 }
253 id
254 }
255 description
256 externalUrl
257 buttonName
258 photos(first: $pageSize) {
259 totalCount
260 edges {
261 cursor
262 node {
263 id
264 legacyId
265 canonicalPath
266 name
267 description
268 category
269 uploadedAt
270 location
271 width
272 height
273 isLikedByMe
274 photographer: uploader {
275 id
276 legacyId
277 username
278 displayName
279 canonicalPath
280 avatar {
281 images(sizes: SMALL) {
282 url
283 id
284 }
285 id
286 }
287 followedByUsers {
288 totalCount
289 isFollowedByMe
290 }
291 }
292 images(sizes: [33, 32]) {
293 size
294 url
295 webpUrl
296 id
297 }
298 __typename
299 }
300 }
301 pageInfo {
302 endCursor
303 hasNextPage
304 }
305 }
306 }
307 """
308
309 GalleriesDetailPaginationContainerQuery = """\
310 query GalleriesDetailPaginationContainerQuery($ownerLegacyId: String, $slug: String, $token: String, $pageSize: Int, $cursor: String) {
311 galleryByOwnerIdAndSlugOrToken(ownerLegacyId: $ownerLegacyId, slug: $slug, token: $token) {
312 ...GalleriesDetailPaginationContainer_gallery_3e6UuE
313 id
314 }
315 }
316
317 fragment GalleriesDetailPaginationContainer_gallery_3e6UuE on Gallery {
318 id
319 legacyId
320 name
321 privacy
322 notSafeForWork
323 ownPhotosOnly
324 canonicalPath
325 publicSlug
326 lastPublishedAt
327 photosAddedSinceLastPublished
328 reportStatus
329 creator {
330 legacyId
331 id
332 }
333 cover {
334 images(sizes: [33, 32, 36, 2048]) {
335 url
336 size
337 webpUrl
338 id
339 }
340 id
341 }
342 description
343 externalUrl
344 buttonName
345 photos(first: $pageSize, after: $cursor) {
346 totalCount
347 edges {
348 cursor
349 node {
350 id
351 legacyId
352 canonicalPath
353 name
354 description
355 category
356 uploadedAt
357 location
358 width
359 height
360 isLikedByMe
361 photographer: uploader {
362 id
363 legacyId
364 username
365 displayName
366 canonicalPath
367 avatar {
368 images(sizes: SMALL) {
369 url
370 id
371 }
372 id
373 }
374 followedByUsers {
375 totalCount
376 isFollowedByMe
377 }
378 }
379 images(sizes: [33, 32]) {
380 size
381 url
382 webpUrl
383 id
384 }
385 __typename
386 }
387 }
388 pageInfo {
389 endCursor
390 hasNextPage
391 }
392 }
393 }
394 """
395
396 LikedPhotosQueryRendererQuery = """\
397 query LikedPhotosQueryRendererQuery($pageSize: Int) {
398 ...LikedPhotosPaginationContainer_query_RlXb8
399 }
400
401 fragment LikedPhotosPaginationContainer_query_RlXb8 on Query {
402 likedPhotos(first: $pageSize) {
403 edges {
404 node {
405 id
406 legacyId
407 canonicalPath
408 name
409 description
410 category
411 uploadedAt
412 location
413 width
414 height
415 isLikedByMe
416 notSafeForWork
417 tags
418 photographer: uploader {
419 id
420 legacyId
421 username
422 displayName
423 canonicalPath
424 avatar {
425 images {
426 url
427 id
428 }
429 id
430 }
431 followedByUsers {
432 totalCount
433 isFollowedByMe
434 }
435 }
436 images(sizes: [33, 35]) {
437 size
438 url
439 jpegUrl
440 webpUrl
441 id
442 }
443 __typename
444 }
445 cursor
446 }
447 pageInfo {
448 endCursor
449 hasNextPage
450 }
451 }
452 }
453 """
454
455 LikedPhotosPaginationContainerQuery = """\
456 query LikedPhotosPaginationContainerQuery($cursor: String, $pageSize: Int) {
457 ...LikedPhotosPaginationContainer_query_3e6UuE
458 }
459
460 fragment LikedPhotosPaginationContainer_query_3e6UuE on Query {
461 likedPhotos(first: $pageSize, after: $cursor) {
462 edges {
463 node {
464 id
465 legacyId
466 canonicalPath
467 name
468 description
469 category
470 uploadedAt
471 location
472 width
473 height
474 isLikedByMe
475 notSafeForWork
476 tags
477 photographer: uploader {
478 id
479 legacyId
480 username
481 displayName
482 canonicalPath
483 avatar {
484 images {
485 url
486 id
487 }
488 id
489 }
490 followedByUsers {
491 totalCount
492 isFollowedByMe
493 }
494 }
495 images(sizes: [33, 35]) {
496 size
497 url
498 jpegUrl
499 webpUrl
500 id
501 }
502 __typename
503 }
504 cursor
505 }
506 pageInfo {
507 endCursor
508 hasNextPage
509 }
510 }
511 }
512 """