summaryrefslogtreecommitdiffstats
path: root/gallery_dl/extractor/behance.py
diff options
context:
space:
mode:
Diffstat (limited to 'gallery_dl/extractor/behance.py')
-rw-r--r--gallery_dl/extractor/behance.py381
1 files changed, 199 insertions, 182 deletions
diff --git a/gallery_dl/extractor/behance.py b/gallery_dl/extractor/behance.py
index b081cc9..f13edf7 100644
--- a/gallery_dl/extractor/behance.py
+++ b/gallery_dl/extractor/behance.py
@@ -217,236 +217,253 @@ class BehanceCollectionExtractor(BehanceExtractor):
query = """
query GetMoodboardItemsAndRecommendations(
- $id: Int!
- $firstItem: Int!
- $afterItem: String
- $shouldGetRecommendations: Boolean!
- $shouldGetItems: Boolean!
- $shouldGetMoodboardFields: Boolean!
- ) {
- viewer @include(if: $shouldGetMoodboardFields) {
- isOptedOutOfRecommendations
- }
- moodboard(id: $id) {
- ...moodboardFields @include(if: $shouldGetMoodboardFields)
-
- items(first: $firstItem, after: $afterItem) @include(if: $shouldGetItems)
- {
- pageInfo {
- endCursor
- hasNextPage
- }
- nodes {
- ...nodesFields
- }
- }
+ $id: Int!
+ $firstItem: Int!
+ $afterItem: String
+ $shouldGetRecommendations: Boolean!
+ $shouldGetItems: Boolean!
+ $shouldGetMoodboardFields: Boolean!
+) {
+ viewer @include(if: $shouldGetMoodboardFields) {
+ isOptedOutOfRecommendations
+ isAdmin
+ }
+ moodboard(id: $id) {
+ ...moodboardFields @include(if: $shouldGetMoodboardFields)
- recommendedItems(first: 80) @include(if: $shouldGetRecommendations) {
- nodes {
- ...nodesFields
- fetchSource
- }
+ items(first: $firstItem, after: $afterItem) @include(if: $shouldGetItems) {
+ pageInfo {
+ endCursor
+ hasNextPage
+ }
+ nodes {
+ ...nodesFields
}
}
- }
- fragment moodboardFields on Moodboard {
- id
- label
- privacy
- followerCount
- isFollowing
- projectCount
- url
- isOwner
- owners {
- id
- displayName
- url
- firstName
- location
- locationUrl
- images {
- size_50 {
- url
- }
- size_100 {
- url
- }
- size_115 {
- url
- }
- size_230 {
- url
- }
- size_138 {
- url
- }
- size_276 {
- url
- }
+ recommendedItems(first: 80) @include(if: $shouldGetRecommendations) {
+ nodes {
+ ...nodesFields
+ fetchSource
}
}
}
-
- fragment projectFields on Project {
+}
+
+fragment moodboardFields on Moodboard {
+ id
+ label
+ privacy
+ followerCount
+ isFollowing
+ projectCount
+ url
+ isOwner
+ owners {
id
- isOwner
- publishedOn
- matureAccess
- hasMatureContent
- modifiedOn
- name
+ displayName
url
- isPrivate
- slug
- fields {
- label
- }
- colors {
- r
- g
- b
- }
- owners {
- url
- displayName
- id
- location
- locationUrl
- isProfileOwner
- images {
- size_50 {
- url
- }
- size_100 {
- url
- }
- size_115 {
- url
- }
- size_230 {
- url
- }
- size_138 {
- url
- }
- size_276 {
- url
- }
+ firstName
+ location
+ locationUrl
+ isFollowing
+ images {
+ size_50 {
+ url
}
- }
- covers {
- size_original {
+ size_100 {
url
}
- size_max_808 {
+ size_115 {
url
}
- size_808 {
+ size_230 {
url
}
- size_404 {
+ size_138 {
url
}
- size_202 {
+ size_276 {
url
}
- size_230 {
+ }
+ }
+}
+
+fragment projectFields on Project {
+ id
+ isOwner
+ publishedOn
+ matureAccess
+ hasMatureContent
+ modifiedOn
+ name
+ url
+ isPrivate
+ slug
+ license {
+ license
+ description
+ id
+ label
+ url
+ text
+ images
+ }
+ fields {
+ label
+ }
+ colors {
+ r
+ g
+ b
+ }
+ owners {
+ url
+ displayName
+ id
+ location
+ locationUrl
+ isProfileOwner
+ isFollowing
+ images {
+ size_50 {
+ url
+ }
+ size_100 {
url
}
size_115 {
url
}
- }
- stats {
- views {
- all
+ size_230 {
+ url
}
- appreciations {
- all
+ size_138 {
+ url
}
- comments {
- all
+ size_276 {
+ url
}
}
}
-
- fragment exifDataValueFields on exifDataValue {
- id
- label
- value
- searchValue
+ covers {
+ size_original {
+ url
+ }
+ size_max_808 {
+ url
+ }
+ size_808 {
+ url
+ }
+ size_404 {
+ url
+ }
+ size_202 {
+ url
+ }
+ size_230 {
+ url
+ }
+ size_115 {
+ url
+ }
+ }
+ stats {
+ views {
+ all
+ }
+ appreciations {
+ all
+ }
+ comments {
+ all
+ }
+ }
+}
+
+fragment exifDataValueFields on exifDataValue {
+ id
+ label
+ value
+ searchValue
+}
+
+fragment nodesFields on MoodboardItem {
+ id
+ entityType
+ width
+ height
+ flexWidth
+ flexHeight
+ images {
+ size
+ url
}
- fragment nodesFields on MoodboardItem {
- id
- entityType
- width
- height
- flexWidth
- flexHeight
- images {
- size
- url
+ entity {
+ ... on Project {
+ ...projectFields
}
- entity {
- ... on Project {
+ ... on ImageModule {
+ project {
...projectFields
}
- ... on ImageModule {
- project {
- ...projectFields
- }
+ colors {
+ r
+ g
+ b
+ }
- exifData {
- lens {
- ...exifDataValueFields
- }
- software {
- ...exifDataValueFields
- }
- makeAndModel {
- ...exifDataValueFields
- }
- focalLength {
- ...exifDataValueFields
- }
- iso {
- ...exifDataValueFields
- }
- location {
- ...exifDataValueFields
- }
- flash {
- ...exifDataValueFields
- }
- exposureMode {
- ...exifDataValueFields
- }
- shutterSpeed {
- ...exifDataValueFields
- }
- aperture {
- ...exifDataValueFields
- }
+ exifData {
+ lens {
+ ...exifDataValueFields
+ }
+ software {
+ ...exifDataValueFields
+ }
+ makeAndModel {
+ ...exifDataValueFields
+ }
+ focalLength {
+ ...exifDataValueFields
+ }
+ iso {
+ ...exifDataValueFields
+ }
+ location {
+ ...exifDataValueFields
+ }
+ flash {
+ ...exifDataValueFields
+ }
+ exposureMode {
+ ...exifDataValueFields
+ }
+ shutterSpeed {
+ ...exifDataValueFields
+ }
+ aperture {
+ ...exifDataValueFields
}
}
+ }
- ... on MediaCollectionComponent {
- project {
- ...projectFields
- }
+ ... on MediaCollectionComponent {
+ project {
+ ...projectFields
}
}
}
+}
"""
variables = {
"afterItem": "MAo=",
"firstItem": 40,
- "id" : self.collection_id,
+ "id" : int(self.collection_id),
"shouldGetItems" : True,
"shouldGetMoodboardFields": False,
"shouldGetRecommendations": False,