Projects STRLCPY maigret Commits 4aeacef0
🤬
Revision indexing in progress... (symbol navigation in revisions will be accurate after indexed)
  • ■ ■ ■ ■ ■ ■
    maigret/maigret.py
    skipped 32 lines
    33 33   SUPPORTED_JSON_REPORT_FORMATS,
    34 34   save_json_report,
    35 35   get_plaintext_report,
     36 + sort_report_by_data_points,
    36 37  )
    37 38  from .sites import MaigretDatabase
    38 39  from .submit import submit_dialog
    skipped 394 lines
    433 434   help=f"Generate a JSON report of specific type: {', '.join(SUPPORTED_JSON_REPORT_FORMATS)}"
    434 435   " (one report per username).",
    435 436   )
     437 + 
     438 + parser.add_argument(
     439 + "--reports-sorting",
     440 + default='default',
     441 + choices=('default', 'data'),
     442 + help="Method of results sorting in reports (default: in order of getting the result)",
     443 + )
    436 444   return parser
    437 445   
    438 446   
    skipped 173 lines
    612 620   )
    613 621   
    614 622   notify_about_errors(results, query_notify)
     623 + 
     624 + if args.reports_sorting == "data":
     625 + results = sort_report_by_data_points(results)
    615 626   
    616 627   general_results.append((username, id_type, results))
    617 628   
    skipped 69 lines
  • ■ ■ ■ ■ ■ ■
    maigret/report.py
    skipped 35 lines
    36 36   return filtered_supposed_data
    37 37   
    38 38   
     39 +def sort_report_by_data_points(results):
     40 + return dict(
     41 + sorted(
     42 + results.items(),
     43 + key=lambda x: len((x[1]['status'].ids_data or {}).keys()),
     44 + reverse=True,
     45 + )
     46 + )
     47 + 
     48 + 
    39 49  """
    40 50  REPORTS SAVING
    41 51  """
    skipped 333 lines
  • ■ ■ ■ ■ ■ ■
    maigret/resources/data.json
    skipped 13034 lines
    13035 13035   "us"
    13036 13036   ],
    13037 13037   "headers": {
    13038  - "authorization": "Bearer BQBFMMVu1dPwJPlnzUteNyF8xlZy7545QnhHizEHWEUQGQrRLznY5k9B9v7JdAsL-wU-Tcep51JTqBesKKY"
     13038 + "authorization": "Bearer BQDV85OO3yWO4yi95C8pEH---y_0fc2KxTYWFy1SjhaoSlN0jbyS6IR7q_noWYoXN1lSA4_FYL9UmAb1e1M"
    13039 13039   },
    13040 13040   "errors": {
    13041 13041   "Spotify is currently not available in your country.": "Access denied in your country, use proxy/vpn"
    skipped 1421 lines
    14463 14463   "sec-ch-ua": "Google Chrome\";v=\"87\", \" Not;A Brand\";v=\"99\", \"Chromium\";v=\"87\"",
    14464 14464   "authorization": "Bearer AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA",
    14465 14465   "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",
    14466  - "x-guest-token": "1394397954526560260"
     14466 + "x-guest-token": "1396147935914733569"
    14467 14467   },
    14468 14468   "errors": {
    14469 14469   "Bad guest token": "x-guest-token update required"
    skipped 400 lines
    14870 14870   "video"
    14871 14871   ],
    14872 14872   "headers": {
    14873  - "Authorization": "jwt eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE2MjEyODYyODAsInVzZXJfaWQiOm51bGwsImFwcF9pZCI6NTg0NzksInNjb3BlcyI6InB1YmxpYyIsInRlYW1fdXNlcl9pZCI6bnVsbH0.mxLdaOuP260WcxBvhadTTUQyn8t75pWNhTmtZLFS-W4"
     14873 + "Authorization": "jwt eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE2MjE3MDQ0ODAsInVzZXJfaWQiOm51bGwsImFwcF9pZCI6NTg0NzksInNjb3BlcyI6InB1YmxpYyIsInRlYW1fdXNlcl9pZCI6bnVsbH0.uJk5fpJb7c-7uuN7CKmlD13SqfNbBrCPnnOXdrdX6u8"
    14874 14874   },
    14875 14875   "activation": {
    14876 14876   "url": "https://vimeo.com/_rv/viewer",
    skipped 13103 lines
  • ■ ■ ■ ■ ■
    tests/test_cli.py
    skipped 24 lines
    25 25   'print_check_errors': False,
    26 26   'print_not_found': False,
    27 27   'proxy': None,
     28 + 'reports_sorting': 'default',
    28 29   'retries': 1,
    29 30   'self_check': False,
    30 31   'site_list': [],
    skipped 66 lines
Please wait...
Page is in error, reload to recover