[reactor] sort 'tags'

to ensure a consistent order for test results
This commit is contained in:
Mike Fährmann 2020-08-15 18:22:31 +02:00
parent cd9de613a2
commit 7619152988
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

View File

@ -112,6 +112,7 @@ class ReactorExtractor(SharedConfigMixin, Extractor):
if not tags:
title, tags = tags, title
tags = tags.split(" :: ")
tags.sort()
for image in images:
url = text.extract(image, ' src="', '"')[0]
@ -259,19 +260,19 @@ class JoyreactorPostExtractor(ReactorPostExtractor):
test = (
("http://joyreactor.com/post/3721876", { # single image
"url": "6ce09f239d8b7fdf6dd1664c2afc39618cc87663",
"keyword": "966d2acd462732a9ed823a9db5ed19f95734fd10",
"keyword": "147ed5b9799ba43cbd16168450afcfae5ddedbf3",
}),
("http://joyreactor.com/post/3713804", { # 4 images
"url": "f08ac8493ca0619a3e3c6bedb8d8374af3eec304",
"keyword": "84e34d402342607045a65fab6d4d593d146c238a",
"keyword": "f12c6f3c2f298fed9b12bd3e70fb823870aa9b93",
}),
("http://joyreactor.com/post/3726210", { # gif / video
"url": "33a48e1eca6cb2d298fbbb6536b3283799d6515b",
"keyword": "dbe148d576f2fc9431020c557ddb78f449e48c47",
"keyword": "d173cc6e88f02a63904e475eacd7050304eb1967",
}),
("http://joyreactor.com/post/3668724", { # youtube embed
"url": "bf1666eddcff10c9b58f6be63fa94e4e13074214",
"keyword": "989112c7888e9cc80fd35870180c6c98165d953b",
"keyword": "e18b1ffbd79d76f9a0e90b6d474cc2499e343f0b",
}),
("http://joyreactor.cc/post/1299", { # "malformed" JSON
"url": "ac900743ed7cf1baf3db3b531c3bc414bf1ffcde",