Debian Codegraph @

gallery_dl/extractor/utils/cosmos_graphql.py

raw symbols SCIP
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 GetElementDetails = """\
11 query GetElementDetails(\
12 $elementId: ElementId!, $userId: UserId!, $isLoggedIn: Boolean!) {
13 elementView(elementId: $elementId) {
14 __typename
15 element {
16 ...ElementTile
17 userContext(userId: $userId) @include(if: $isLoggedIn) {
18 ...ElementUserContext
19 __typename
20 }
21 generatedCaption {
22 text
23 __typename
24 }
25 __typename
26 }
27 ... on MultiMediaElementView {
28 media {
29 ...ElementMedia
30 __typename
31 }
32 __typename
33 }
34 ... on OembedElementView {
35 html
36 __typename
37 }
38 }
39 elementQuickConnectRecommendation(\
40 userId: $userId, elementId: $elementId) @include(if: $isLoggedIn) {
41 isConnected
42 cluster {
43 id
44 name
45 cover {
46 url
47 blurHash
48 __typename
49 }
50 __typename
51 }
52 __typename
53 }
54 }
55
56 fragment ElementTile on ElementTile {
57 __typename
58 id
59 processingState
60 contentAccessibility
61 createdAt
62 isFeatured
63 isReadyToShow
64 ownerId
65 shareUrl
66 originalClusterId
67 generatedCaption {
68 text
69 __typename
70 }
71 source {
72 ...ElementSource
73 __typename
74 }
75 ... on MediaElementTile {
76 hasMoreMedia
77 multipleMedia {
78 ...ElementMedia
79 __typename
80 }
81 media {
82 ...ElementMedia
83 __typename
84 }
85 __typename
86 }
87 ... on ProductElementTile {
88 media {
89 ...ElementMedia
90 __typename
91 }
92 productPrice: price {
93 value
94 currency
95 __typename
96 }
97 productBrand: brand
98 productTitle: name
99 productDescription: description
100 __typename
101 }
102 ... on WebsiteElementTile {
103 media {
104 ...ElementMedia
105 __typename
106 }
107 websiteTitle: title
108 websiteDescription: description
109 __typename
110 }
111 ... on TextElementTile {
112 text
113 __typename
114 }
115 }
116
117 fragment ElementMedia on Media {
118 url
119 width
120 height
121 notSafeForWorkStatus
122 aiGenerated
123 __typename
124 ... on StaticImage {
125 blurHash
126 __typename
127 }
128 ... on AnimatedImage {
129 blurHash
130 video {
131 url
132 thumbnailUrl
133 __typename
134 }
135 __typename
136 }
137 ... on Video {
138 thumbnail {
139 hash
140 url
141 __typename
142 }
143 duration
144 isStored
145 mux {
146 playbackUrl
147 mp4Url(quality: LOW)
148 downloadableUrl: mp4Url(quality: HIGH)
149 __typename
150 }
151 width
152 height
153 __typename
154 }
155 ... on Media {
156 __typename
157 }
158 }
159
160 fragment ElementSource on ElementSource {
161 url
162 isEditable
163 isPublicDomain
164 author {
165 username
166 fullName
167 profileUrl
168 avatarUrl
169 __typename
170 }
171 __typename
172 }
173
174 fragment ElementUserContext on ElementUserContext {
175 isDisliked
176 isPublicElement
177 connections {
178 meta {
179 count
180 __typename
181 }
182 __typename
183 }
184 __typename
185 }
186 """
187
188
189 GetUserPublicElementsV2 = """\
190 query GetUserPublicElementsV2(\
191 $userId: UserId!, $callingUserId: UserId, $pageCursor: String, \
192 $filters: UserElementListFilters, $isLoggedIn: Boolean!) {
193 userPublicElements(
194 userId: $userId
195 filters: $filters
196 meta: {pageCursor: $pageCursor, pageSize: 40}
197 ) {
198 items {
199 ...ElementTile
200 userContext(userId: $callingUserId) @include(if: $isLoggedIn) {
201 ...ElementUserContext
202 __typename
203 }
204 __typename
205 }
206 meta {
207 nextPageCursor
208 count
209 __typename
210 }
211 __typename
212 }
213 }
214
215 fragment ElementTile on ElementTile {
216 __typename
217 id
218 processingState
219 contentAccessibility
220 createdAt
221 isFeatured
222 isReadyToShow
223 ownerId
224 shareUrl
225 originalClusterId
226 generatedCaption {
227 text
228 __typename
229 }
230 source {
231 ...ElementSource
232 __typename
233 }
234 ... on MediaElementTile {
235 hasMoreMedia
236 multipleMedia {
237 ...ElementMedia
238 __typename
239 }
240 media {
241 ...ElementMedia
242 __typename
243 }
244 __typename
245 }
246 ... on ProductElementTile {
247 media {
248 ...ElementMedia
249 __typename
250 }
251 productPrice: price {
252 value
253 currency
254 __typename
255 }
256 productBrand: brand
257 productTitle: name
258 productDescription: description
259 __typename
260 }
261 ... on WebsiteElementTile {
262 media {
263 ...ElementMedia
264 __typename
265 }
266 websiteTitle: title
267 websiteDescription: description
268 __typename
269 }
270 ... on TextElementTile {
271 text
272 __typename
273 }
274 }
275
276 fragment ElementMedia on Media {
277 url
278 width
279 height
280 notSafeForWorkStatus
281 aiGenerated
282 __typename
283 ... on StaticImage {
284 blurHash
285 __typename
286 }
287 ... on AnimatedImage {
288 blurHash
289 video {
290 url
291 thumbnailUrl
292 __typename
293 }
294 __typename
295 }
296 ... on Video {
297 thumbnail {
298 hash
299 url
300 __typename
301 }
302 duration
303 isStored
304 mux {
305 playbackUrl
306 mp4Url(quality: LOW)
307 downloadableUrl: mp4Url(quality: HIGH)
308 __typename
309 }
310 width
311 height
312 __typename
313 }
314 ... on Media {
315 __typename
316 }
317 }
318
319 fragment ElementSource on ElementSource {
320 url
321 isEditable
322 isPublicDomain
323 author {
324 username
325 fullName
326 profileUrl
327 avatarUrl
328 __typename
329 }
330 __typename
331 }
332
333 fragment ElementUserContext on ElementUserContext {
334 isDisliked
335 isPublicElement
336 connections {
337 meta {
338 count
339 __typename
340 }
341 __typename
342 }
343 __typename
344 }
345 """
346
347
348 GetClusterBasic = """\
349 query GetClusterBasic(\
350 $slug: String!, $subclusterSlug: String, $ownerUsername: String!, \
351 $userId: UserId!, $fetchSubCluster: Boolean!, $isLoggedIn: Boolean!) {
352 cluster(input: {slug: $slug, ownerUsername: $ownerUsername}) {
353 ...ClusterBasic
354 isCollaborator(userId: $userId)
355 subCluster(slug: $subclusterSlug) @include(if: $fetchSubCluster) {
356 ...ClusterBasic
357 isCollaborator(userId: $userId)
358 __typename
359 }
360 __typename
361 }
362 }
363
364 fragment ClusterBasic on Cluster {
365 id
366 name
367 isPublicElementsCluster
368 description
369 slug
370 isPrivate
371 ownerId
372 owner {
373 ...UserPublicProfile
374 isFollowed(followerId: $userId) @include(if: $isLoggedIn)
375 __typename
376 }
377 coverImageElementId
378 coverImageUrl
379 isFollowed(userId: $userId) @include(if: $isLoggedIn)
380 isFeatured
381 parentClusterId
382 isPinnedToUserProfile(userId: $userId) @include(if: $isLoggedIn)
383 numberOfElements
384 cover {
385 notSafeForWorkStatus
386 url
387 blurHash
388 width
389 height
390 aiGenerated
391 ... on AnimatedImage {
392 video {
393 url
394 thumbnailUrl
395 __typename
396 }
397 __typename
398 }
399 __typename
400 }
401 collaborators {
402 items {
403 ...ClusterCollaborator
404 isOwner
405 status
406 __typename
407 }
408 __typename
409 }
410 __typename
411 }
412
413 fragment ClusterCollaborator on Collaborator {
414 userId
415 collaboratorPublicProfile {
416 ...UserPublicProfile
417 __typename
418 }
419 __typename
420 }
421
422 fragment UserPublicProfile on UserPublicProfile {
423 id
424 fullName
425 username
426 avatarUrl
427 isPremium
428 publicElementsCluster {
429 id
430 numberOfElements
431 __typename
432 }
433 __typename
434 }
435 """
436
437
438 GetClusterElements = """\
439 query GetClusterElements(\
440 $clusterId: ClusterId, $pageCursor: String, $userId: UserId, $pageSize: Int, \
441 $isLoggedIn: Boolean!, $showCollaborator: Boolean!) {
442 clusterConnections(
443 clusterId: $clusterId
444 meta: {pageSize: $pageSize, pageCursor: $pageCursor}
445 ) {
446 items {
447 element {
448 ...ElementTile
449 userContext(userId: $userId) @include(if: $isLoggedIn) {
450 ...ElementUserContext
451 __typename
452 }
453 connection(cluster: {id: $clusterId}) @include(if: $showCollaborator) {
454 collaborator {
455 id
456 username
457 avatarUrl
458 isPremium
459 __typename
460 }
461 __typename
462 }
463 __typename
464 }
465 __typename
466 }
467 meta {
468 nextPageCursor
469 count
470 __typename
471 }
472 __typename
473 }
474 }
475
476 fragment ElementTile on ElementTile {
477 __typename
478 id
479 processingState
480 contentAccessibility
481 createdAt
482 isFeatured
483 isReadyToShow
484 ownerId
485 shareUrl
486 originalClusterId
487 generatedCaption {
488 text
489 __typename
490 }
491 source {
492 ...ElementSource
493 __typename
494 }
495 ... on MediaElementTile {
496 hasMoreMedia
497 multipleMedia {
498 ...ElementMedia
499 __typename
500 }
501 media {
502 ...ElementMedia
503 __typename
504 }
505 __typename
506 }
507 ... on ProductElementTile {
508 media {
509 ...ElementMedia
510 __typename
511 }
512 productPrice: price {
513 value
514 currency
515 __typename
516 }
517 productBrand: brand
518 productTitle: name
519 productDescription: description
520 __typename
521 }
522 ... on WebsiteElementTile {
523 media {
524 ...ElementMedia
525 __typename
526 }
527 websiteTitle: title
528 websiteDescription: description
529 __typename
530 }
531 ... on TextElementTile {
532 text
533 __typename
534 }
535 }
536
537 fragment ElementMedia on Media {
538 url
539 width
540 height
541 notSafeForWorkStatus
542 aiGenerated
543 __typename
544 ... on StaticImage {
545 blurHash
546 __typename
547 }
548 ... on AnimatedImage {
549 blurHash
550 video {
551 url
552 thumbnailUrl
553 __typename
554 }
555 __typename
556 }
557 ... on Video {
558 thumbnail {
559 hash
560 url
561 __typename
562 }
563 duration
564 isStored
565 mux {
566 playbackUrl
567 mp4Url(quality: LOW)
568 downloadableUrl: mp4Url(quality: HIGH)
569 __typename
570 }
571 width
572 height
573 __typename
574 }
575 ... on Media {
576 __typename
577 }
578 }
579
580 fragment ElementSource on ElementSource {
581 url
582 isEditable
583 isPublicDomain
584 author {
585 username
586 fullName
587 profileUrl
588 avatarUrl
589 __typename
590 }
591 __typename
592 }
593
594 fragment ElementUserContext on ElementUserContext {
595 isDisliked
596 isPublicElement
597 connections {
598 meta {
599 count
600 __typename
601 }
602 __typename
603 }
604 __typename
605 }
606 """
607
608
609 GetUserClusters = """\
610 query GetUserClusters(\
611 $ownerId: UserId!, $userId: UserId!, $pageCursor: String, \
612 $pageSize: Int = 20, $order: UserProfileClusterOrder, \
613 $filters: UserClusterListFilters, $isLoggedIn: Boolean!) {
614 userClusters(
615 userId: $ownerId
616 meta: {pageSize: $pageSize, pageCursor: $pageCursor}
617 order: $order
618 filters: $filters
619 ) {
620 items {
621 ...ClusterTile
622 ...Subclusters
623 __typename
624 }
625 meta {
626 nextPageCursor
627 count
628 __typename
629 }
630 __typename
631 }
632 }
633
634 fragment ClusterTile on Cluster {
635 ...ClusterBasic
636 collaboratorsCount
637 numberOfElements
638 collaborators {
639 items {
640 ...ClusterCollaborator
641 isOwner
642 __typename
643 }
644 __typename
645 }
646 subClusters {
647 meta {
648 count
649 __typename
650 }
651 __typename
652 }
653 __typename
654 }
655
656 fragment ClusterBasic on Cluster {
657 id
658 name
659 isPublicElementsCluster
660 description
661 slug
662 isPrivate
663 ownerId
664 owner {
665 ...UserPublicProfile
666 isFollowed(followerId: $userId) @include(if: $isLoggedIn)
667 __typename
668 }
669 coverImageElementId
670 coverImageUrl
671 isFollowed(userId: $userId) @include(if: $isLoggedIn)
672 isFeatured
673 parentClusterId
674 isPinnedToUserProfile(userId: $userId) @include(if: $isLoggedIn)
675 numberOfElements
676 cover {
677 notSafeForWorkStatus
678 url
679 blurHash
680 width
681 height
682 aiGenerated
683 ... on AnimatedImage {
684 video {
685 url
686 thumbnailUrl
687 __typename
688 }
689 __typename
690 }
691 __typename
692 }
693 collaborators {
694 items {
695 ...ClusterCollaborator
696 isOwner
697 status
698 __typename
699 }
700 __typename
701 }
702 __typename
703 }
704
705 fragment ClusterCollaborator on Collaborator {
706 userId
707 collaboratorPublicProfile {
708 ...UserPublicProfile
709 __typename
710 }
711 __typename
712 }
713
714 fragment UserPublicProfile on UserPublicProfile {
715 id
716 fullName
717 username
718 avatarUrl
719 isPremium
720 publicElementsCluster {
721 id
722 numberOfElements
723 __typename
724 }
725 __typename
726 }
727
728 fragment Subclusters on Cluster {
729 subClusters {
730 __typename
731 items {
732 __typename
733 id
734 name
735 slug
736 coverImageUrl
737 cover {
738 __typename
739 blurHash
740 aiGenerated
741 notSafeForWorkStatus
742 }
743 numberOfElements
744 isPrivate
745 }
746 }
747 __typename
748 }
749 """
750
751
752 SearchGlobalElements = """\
753 query SearchGlobalElements(\
754 $userId: UserId, $searchTerm: String!, \
755 $contentType: ElementContentTypeFilter, $origin: SearchOrigin, \
756 $pageCursor: String, $order: ElementOrder, $color: String) {
757 searchElements(
758 filters: {color: $color, userId: $userId, contentType: $contentType}
759 order: $order
760 searchTerm: $searchTerm
761 searchOrigin: $origin
762 meta: {pageSize: 40, pageCursor: $pageCursor}
763 ) {
764 items {
765 ...ElementTile
766 slateId
767 __typename
768 }
769 meta {
770 nextPageCursor
771 count
772 __typename
773 }
774 __typename
775 }
776 }
777
778 fragment ElementTile on ElementTile {
779 __typename
780 id
781 processingState
782 contentAccessibility
783 createdAt
784 isFeatured
785 isReadyToShow
786 ownerId
787 shareUrl
788 originalClusterId
789 generatedCaption {
790 text
791 __typename
792 }
793 source {
794 ...ElementSource
795 __typename
796 }
797 ... on MediaElementTile {
798 hasMoreMedia
799 multipleMedia {
800 ...ElementMedia
801 __typename
802 }
803 media {
804 ...ElementMedia
805 __typename
806 }
807 __typename
808 }
809 ... on ProductElementTile {
810 media {
811 ...ElementMedia
812 __typename
813 }
814 productPrice: price {
815 value
816 currency
817 __typename
818 }
819 productBrand: brand
820 productTitle: name
821 productDescription: description
822 __typename
823 }
824 ... on WebsiteElementTile {
825 media {
826 ...ElementMedia
827 __typename
828 }
829 websiteTitle: title
830 websiteDescription: description
831 __typename
832 }
833 ... on TextElementTile {
834 text
835 __typename
836 }
837 }
838
839 fragment ElementMedia on Media {
840 url
841 width
842 height
843 notSafeForWorkStatus
844 aiGenerated
845 __typename
846 ... on StaticImage {
847 blurHash
848 __typename
849 }
850 ... on AnimatedImage {
851 blurHash
852 video {
853 url
854 thumbnailUrl
855 __typename
856 }
857 __typename
858 }
859 ... on Video {
860 thumbnail {
861 hash
862 url
863 __typename
864 }
865 duration
866 isStored
867 mux {
868 playbackUrl
869 mp4Url(quality: LOW)
870 downloadableUrl: mp4Url(quality: HIGH)
871 __typename
872 }
873 width
874 height
875 __typename
876 }
877 ... on Media {
878 __typename
879 }
880 }
881
882 fragment ElementSource on ElementSource {
883 url
884 isEditable
885 isPublicDomain
886 author {
887 username
888 fullName
889 profileUrl
890 avatarUrl
891 __typename
892 }
893 __typename
894 }
895 """