Spotify added, Steam ID processing updated

This commit is contained in:
Soxoj
2021-02-18 20:53:26 +03:00
parent 8391d7317d
commit 1a77bc7472
4 changed files with 84 additions and 9 deletions
+9
View File
@@ -27,6 +27,15 @@ class ParsingActivator:
jwt_token = r.json()['jwt'] jwt_token = r.json()['jwt']
site.headers['Authorization'] = 'jwt ' + jwt_token site.headers['Authorization'] = 'jwt ' + jwt_token
@staticmethod
def spotify(site, logger, cookies={}):
headers = dict(site.headers)
if 'Authorization' in headers:
del headers['Authorization']
r = requests.get(site.activation['url'])
bearer_token = r.json()['accessToken']
site.headers['authorization'] = f'Bearer {bearer_token}'
@staticmethod @staticmethod
def xssis(site, logger, cookies={}): def xssis(site, logger, cookies={}):
if not cookies: if not cookies:
+2
View File
@@ -20,6 +20,7 @@ supported_recursive_search_ids = (
'vk_id', 'vk_id',
'ok_id', 'ok_id',
'wikimapia_uid', 'wikimapia_uid',
'steam_id',
) )
common_errors = { common_errors = {
@@ -332,6 +333,7 @@ async def maigret(username, site_dict, query_notify, logger,
cookie_jar = None cookie_jar = None
if cookies: if cookies:
logger.debug(f'Using cookies jar file {cookies}')
cookie_jar = await import_aiohttp_cookies(cookies) cookie_jar = await import_aiohttp_cookies(cookies)
session = aiohttp.ClientSession(connector=connector, trust_env=True, cookie_jar=cookie_jar) session = aiohttp.ClientSession(connector=connector, trust_env=True, cookie_jar=cookie_jar)
+1 -1
View File
@@ -67,7 +67,7 @@ async def main():
action="store", metavar='TIMEOUT', action="store", metavar='TIMEOUT',
dest="timeout", type=timeout_check, default=10, dest="timeout", type=timeout_check, default=10,
help="Time (in seconds) to wait for response to requests." help="Time (in seconds) to wait for response to requests."
"Default timeout of 10.0s." "Default timeout of 10.0s. "
"A longer timeout will be more likely to get results from slow sites." "A longer timeout will be more likely to get results from slow sites."
"On the other hand, this may cause a long delay to gather all results." "On the other hand, this may cause a long delay to gather all results."
) )
+72 -8
View File
@@ -12228,9 +12228,23 @@
"tags": [ "tags": [
"music" "music"
], ],
"headers": {
"authorization": "Bearer BQAlrJSKV_X_SgmGTiRWa2Q7FDLUFK6PiNNMhrdbhl0OccgNhCajMTaSPJuw18sckyjbw4j1nCYN-GmFBBs"
},
"errors": { "errors": {
"Spotify is currently not available in your country.": "Access denied in your country, use proxy/vpn" "Spotify is currently not available in your country.": "Access denied in your country, use proxy/vpn"
}, },
"activation": {
"method": "spotify",
"marks": [
"No token provided",
"The access token expired"
],
"url": "https://open.spotify.com/get_access_token?reason=transport&productType=web_player",
"src": "accessToken",
"dst": "authorization"
},
"urlProbe": "https://spclient.wg.spotify.com/user-profile-view/v3/profile/{username}?playlist_limit=10&artist_limit=10&market=EN",
"checkType": "status_code", "checkType": "status_code",
"alexaRank": 81, "alexaRank": 81,
"url": "https://open.spotify.com/user/{username}", "url": "https://open.spotify.com/user/{username}",
@@ -12311,7 +12325,8 @@
}, },
"Steam": { "Steam": {
"tags": [ "tags": [
"gaming" "gaming",
"steam"
], ],
"checkType": "message", "checkType": "message",
"absenceStrs": "The specified profile could not be found", "absenceStrs": "The specified profile could not be found",
@@ -12323,7 +12338,8 @@
}, },
"SteamGroup": { "SteamGroup": {
"tags": [ "tags": [
"us" "us",
"steam"
], ],
"checkType": "message", "checkType": "message",
"absenceStrs": "No group could be retrieved for the given URL", "absenceStrs": "No group could be retrieved for the given URL",
@@ -12334,11 +12350,9 @@
"usernameUnclaimed": "noonewouldeverusethis7" "usernameUnclaimed": "noonewouldeverusethis7"
}, },
"Steamid": { "Steamid": {
"disabled": true,
"tags": [ "tags": [
"ru", "gaming",
"tr", "steam"
"us"
], ],
"checkType": "message", "checkType": "message",
"absenceStrs": "<div class=\"alert alert-warning\">Profile not found</div>", "absenceStrs": "<div class=\"alert alert-warning\">Profile not found</div>",
@@ -12348,6 +12362,55 @@
"usernameClaimed": "blue", "usernameClaimed": "blue",
"usernameUnclaimed": "noonewouldeverusethis7" "usernameUnclaimed": "noonewouldeverusethis7"
}, },
"Steamid (by id)": {
"tags": [
"gaming",
"steam"
],
"type": "steam_id",
"checkType": "message",
"absenceStrs": "<div class=\"alert alert-warning\">Profile not found</div>",
"alexaRank": 265679,
"url": "https://steamid.uk/profile/{username}",
"urlMain": "https://steamid.uk/",
"usernameClaimed": "76561197982198022",
"usernameUnclaimed": "noonewouldeverusethis7"
},
"Steamidfinder": {
"tags": [
"gaming",
"steam"
],
"checkType": "message",
"presenseStrs": [
"se our custom tools to build a Steam profile badge"
],
"absenceStrs": [
"could not be found."
],
"url": "https://steamidfinder.com/lookup/{username}",
"urlMain": "https://steamidfinder.com",
"usernameClaimed": "channel",
"usernameUnclaimed": "noonewouldeverusethis7"
},
"Steamidfinder (by id)": {
"tags": [
"gaming",
"steam"
],
"type": "steam_id",
"checkType": "message",
"presenseStrs": [
"se our custom tools to build a Steam profile badge"
],
"absenceStrs": [
"could not be found."
],
"url": "https://steamidfinder.com/lookup/{username}",
"urlMain": "https://steamidfinder.com",
"usernameClaimed": "76561197982198022",
"usernameUnclaimed": "noonewouldeverusethis7"
},
"Stereo": { "Stereo": {
"tags": [ "tags": [
"nl", "nl",
@@ -13471,7 +13534,7 @@
"sec-ch-ua": "Google Chrome\";v=\"87\", \" Not;A Brand\";v=\"99\", \"Chromium\";v=\"87\"", "sec-ch-ua": "Google Chrome\";v=\"87\", \" Not;A Brand\";v=\"99\", \"Chromium\";v=\"87\"",
"authorization": "Bearer AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA", "authorization": "Bearer AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA",
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36", "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36",
"x-guest-token": "1362149064209559554" "x-guest-token": "1362450609757171713"
}, },
"errors": { "errors": {
"Bad guest token": "x-guest-token update required" "Bad guest token": "x-guest-token update required"
@@ -13837,7 +13900,7 @@
"video" "video"
], ],
"headers": { "headers": {
"Authorization": "jwt eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE2MTM1OTc1MjAsInVzZXJfaWQiOm51bGwsImFwcF9pZCI6NTg0NzksInNjb3BlcyI6InB1YmxpYyIsInRlYW1fdXNlcl9pZCI6bnVsbH0.dBxgHYOlLckB2zBh3mgINMKRXCIkWnAUQKUhn27_Zj0" "Authorization": "jwt eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE2MTM2Njk0NjAsInVzZXJfaWQiOm51bGwsImFwcF9pZCI6NTg0NzksInNjb3BlcyI6InB1YmxpYyIsInRlYW1fdXNlcl9pZCI6bnVsbH0.EM5FY86CJ5Nel3U0l8GipXRSYYJoeDpS9QURBp5B-UM"
}, },
"activation": { "activation": {
"url": "https://vimeo.com/_rv/viewer", "url": "https://vimeo.com/_rv/viewer",
@@ -14734,6 +14797,7 @@
"usernameUnclaimed": "noonewouldeverusethis7" "usernameUnclaimed": "noonewouldeverusethis7"
}, },
"YandexLocal": { "YandexLocal": {
"disabled": true,
"tags": [ "tags": [
"ru" "ru"
], ],