Skip to content

Commit

Permalink
merge #6891: [vsco] fix 'JSONDecodeError' (#6887)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikf committed Jan 28, 2025
2 parents 8b0f082 + a8c4665 commit de81f8e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion gallery_dl/extractor/vsco.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ def images(self):

def _extract_preload_state(self, url):
page = self.request(url, notfound=self.subcategory).text
return util.json_loads(text.extr(page, "__PRELOADED_STATE__ = ", "<"))
return util.json_loads(text.extr(page, "__PRELOADED_STATE__ = ", "<")
.replace('"prevPageToken":undefined,', ''))

def _pagination(self, url, params, token, key, extra=None):
headers = {
Expand Down
4 changes: 2 additions & 2 deletions test/results/vsco.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"#url" : "https://vsco.co/vsco/avatar",
"#category": ("", "vsco", "avatar"),
"#class" : vsco.VscoAvatarExtractor,
"#urls" : "https://image-aws-us-west-2.vsco.co/3c69ae/304128/652d9f3b39a6007526dda683/vscoprofile-avatar.jpg",
"#pattern" : r"https://(?:image-aws-us-west-2|img).vsco.co/3c69ae/304128/652d9f3b39a6007526dda683/vscoprofile-avatar.jpg",
"#sha1_content" : "57cd648759e34a6daefc5c79542ddb4595b9b677",

"id": "652d9f3b39a6007526dda683",
Expand Down Expand Up @@ -102,7 +102,7 @@
"#url" : "https://vsco.co/jimenalazof/media/5b4feec558f6c45c18c040fd",
"#category": ("", "vsco", "image"),
"#class" : vsco.VscoImageExtractor,
"#sha1_url" : "08e7eef3301756ce81206c0b47c1e9373756a74a",
"#sha1_url" : "c2cf4bd2a627419785613dc5475cbb7c2699f3dd",
"#sha1_content": "e739f058d726ee42c51c180a505747972a7dfa47",

"video": True,
Expand Down

0 comments on commit de81f8e

Please sign in to comment.