diff --git a/maigret/activation.py b/maigret/activation.py index 77e6975..b9f42cf 100644 --- a/maigret/activation.py +++ b/maigret/activation.py @@ -10,3 +10,12 @@ class ParsingActivator: j = r.json() guest_token = j[site.activation['src']] site.headers['x-guest-token'] = guest_token + + @staticmethod + def vimeo(site, logger): + headers = dict(site.headers) + if 'Authorization' in headers: + del headers['Authorization'] + r = requests.get(site.activation['url'], headers=headers) + jwt_token = r.json()['jwt'] + site.headers['Authorization'] = 'jwt ' + jwt_token diff --git a/maigret/maigret.py b/maigret/maigret.py index 2787d25..8f85ea4 100755 --- a/maigret/maigret.py +++ b/maigret/maigret.py @@ -182,7 +182,7 @@ def process_site_result(response, query_notify, logger, results_info, site: Maig error_text, site_error_text = detect_error_page(html_text, status_code, failure_errors, site.ignore_403) - if site.activation: + if site.activation and html_text: is_need_activation = any([s for s in site.activation['marks'] if s in html_text]) if is_need_activation: method = site.activation['method'] @@ -196,8 +196,8 @@ def process_site_result(response, query_notify, logger, results_info, site: Maig # presense flags # True by default presense_flags = site.presense_strs + is_presense_detected = False if html_text: - is_presense_detected = False if not presense_flags: is_presense_detected = True site.stats['presense_flag'] = None diff --git a/maigret/resources/data.json b/maigret/resources/data.json index eb2047f..47c4c33 100644 --- a/maigret/resources/data.json +++ b/maigret/resources/data.json @@ -309,8 +309,7 @@ "500px": { "tags": [ "global", - "in", - "photos" + "photo" ], "errors": { "INTERNAL_SERVER_ERROR": "Site error", @@ -1004,14 +1003,17 @@ }, "Aptoide": { "tags": [ - "in" + "apps" ], "regexCheck": "^[^\\.]+$", "checkType": "status_code", + "presenseStrs": [ + "BreadcrumbList" + ], "alexaRank": 6653, "url": "https://{username}.en.aptoide.com/", "urlMain": "https://en.aptoide.com/", - "usernameClaimed": "blue", + "usernameClaimed": "kodi", "usernameUnclaimed": "noonewouldeverusethis7" }, "Aqa": { @@ -1552,10 +1554,8 @@ "Badoo": { "disabled": true, "tags": [ - "br", - "de", - "pl", - "social" + "global", + "dating" ], "checkType": "status_code", "alexaRank": 2343, @@ -3224,9 +3224,8 @@ "DeviantART": { "tags": [ "global", - "images", - "photos", - "us" + "photo", + "art" ], "regexCheck": "^[a-zA-Z][a-zA-Z0-9_-]*$", "checkType": "status_code", @@ -3984,12 +3983,8 @@ }, "EyeEm": { "tags": [ - "de", "global", - "in", - "it", - "photos", - "sd" + "photo" ], "checkType": "message", "absenceStrs": "Not Found (404) | EyeEm", @@ -4085,9 +4080,7 @@ }, "Facebook": { "tags": [ - "global", - "social", - "us" + "global" ], "regexCheck": "^[a-zA-Z0-9_\\.]{3,49}(?