Debian Codegraph @

gallery_dl/extractor/utils/scrolller_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 SubredditPostQuery = """\
11 query SubredditPostQuery(
12 $url: String!
13 ) {
14 getPost(
15 data: { url: $url }
16 ) {
17 __typename id url title subredditId subredditTitle subredditUrl
18 redditPath isNsfw hasAudio fullLengthSource gfycatSource redgifsSource
19 ownerAvatar username displayName favoriteCount isPaid tags
20 commentsCount commentsRepliesCount isFavorite
21 albumContent { mediaSources { url width height isOptimized } }
22 mediaSources { url width height isOptimized }
23 blurredMediaSources { url width height isOptimized }
24 }
25 }
26 """
27
28 RedditUserPostsQuery = """\
29 query RedditUserPostsQuery(
30 $username: String!
31 $iterator: String
32 $limit: Int!
33 $filter: GalleryFilter
34 $sortBy: GallerySortBy
35 $nsfw: NsfwFilter!
36 ) {
37 getRedditUserPosts(
38 data: {
39 username: $username
40 iterator: $iterator
41 limit: $limit
42 filter: $filter
43 sortBy: $sortBy
44 nsfw: $nsfw
45 }
46 ) {
47 iterator items {
48 __typename id url title reddit_posted_by subredditId
49 subredditTitle subredditUrl subredditIsFollowing redditPath isNsfw
50 hasAudio fullLengthSource gfycatSource redgifsSource ownerAvatar
51 username displayName favoriteCount isPaid tags commentsCount
52 commentsRepliesCount duration createdAt isFavorite
53 albumContent { mediaSources { url width height isOptimized type } }
54 mediaSources { url width height isOptimized type }
55 blurredMediaSources { url width height isOptimized type }
56 }
57 }
58 }
59 """
60
61 SubredditQuery = """\
62 query SubredditQuery(
63 $url: String!
64 $iterator: String
65 $sortBy: GallerySortBy
66 $filter: GalleryFilter
67 $limit: Int!
68 ) {
69 getSubreddit(
70 data: {
71 url: $url,
72 iterator: $iterator,
73 filter: $filter,
74 limit: $limit,
75 sortBy: $sortBy
76 }
77 ) {
78 __typename id url title secondaryTitle description createdAt isNsfw
79 subscribers isComplete itemCount videoCount pictureCount albumCount
80 isPaid username tags isFollowing
81 banner { url width height isOptimized }
82 children {
83 iterator items {
84 __typename id url title subredditId subredditTitle subredditUrl
85 redditPath isNsfw hasAudio fullLengthSource gfycatSource
86 redgifsSource ownerAvatar username displayName favoriteCount
87 isPaid tags commentsCount commentsRepliesCount isFavorite
88 albumContent { mediaSources { url width height isOptimized } }
89 mediaSources { url width height isOptimized }
90 blurredMediaSources { url width height isOptimized }
91 }
92 }
93 }
94 }
95 """
96
97 SubredditChildrenQuery = """\
98 query SubredditChildrenQuery(
99 $subredditId: Int!
100 $iterator: String
101 $filter: GalleryFilter
102 $sortBy: GallerySortBy
103 $limit: Int!
104 $nsfw: NsfwFilter
105 ) {
106 getSubredditChildren(
107 data: {
108 subredditId: $subredditId,
109 iterator: $iterator,
110 filter: $filter,
111 sortBy: $sortBy,
112 limit: $limit,
113 nsfw: $nsfw
114 },
115 ) {
116 iterator items {
117 __typename id url title subredditId subredditTitle subredditUrl
118 redditPath isNsfw hasAudio fullLengthSource gfycatSource
119 redgifsSource ownerAvatar username displayName favoriteCount isPaid
120 tags commentsCount commentsRepliesCount isFavorite
121 albumContent { mediaSources { url width height isOptimized } }
122 mediaSources { url width height isOptimized }
123 blurredMediaSources { url width height isOptimized }
124 }
125 }
126 }
127 """
128
129 GetFollowingSubreddits = """\
130 query GetFollowingSubreddits(
131 $iterator: String,
132 $limit: Int!,
133 $filter: GalleryFilter,
134 $nsfw: NsfwFilter,
135 $sortBy: GallerySortBy
136 ) {
137 getFollowingSubreddits(
138 data: {
139 nsfw: $nsfw
140 limit: $limit
141 filter: $filter
142 iterator: $iterator
143 sortBy: $sortBy
144 }
145 ) {
146 iterator items {
147 __typename id url title secondaryTitle description createdAt isNsfw
148 subscribers isComplete itemCount videoCount pictureCount albumCount
149 isFollowing
150 }
151 }
152 }
153 """
154
155 LoginQuery = """\
156 query LoginQuery(
157 $username: String!,
158 $password: String!
159 ) {
160 login(
161 username: $username,
162 password: $password
163 ) {
164 username token expiresAt isAdmin status isPremium
165 }
166 }
167 """
168
169 ItemTypeQuery = """\
170 query ItemTypeQuery(
171 $url: String!
172 ) {
173 getItemType(
174 url: $url
175 )
176 }
177 """