Projects STRLCPY maigret Commits cee6f0aa
🤬
Revision indexing in progress... (symbol navigation in revisions will be accurate after indexed)
  • ■ ■ ■ ■ ■
    maigret/checking.py
    skipped 126 lines
    127 127   return str(html_text), status_code, error
    128 128   
    129 129   
    130  -class TorAiohttpChecker(SimpleAiohttpChecker):
     130 +class ProxiedAiohttpChecker(SimpleAiohttpChecker):
    131 131   def __init__(self, *args, **kwargs):
    132 132   proxy = kwargs.get('proxy')
    133 133   cookie_jar = kwargs.get('cookie_jar')
    skipped 422 lines
    556 556   query_notify=None,
    557 557   proxy=None,
    558 558   tor_proxy=None,
     559 + i2p_proxy=None,
    559 560   timeout=3,
    560 561   is_parsing_enabled=False,
    561 562   id_type="username",
    skipped 59 lines
    621 622   # TODO
    622 623   tor_checker = CheckerMock()
    623 624   if tor_proxy:
    624  - tor_checker = TorAiohttpChecker( # type: ignore
     625 + tor_checker = ProxiedAiohttpChecker( # type: ignore
    625 626   proxy=tor_proxy, cookie_jar=cookie_jar, logger=logger
     627 + )
     628 + 
     629 + # TODO
     630 + i2p_checker = CheckerMock()
     631 + if i2p_proxy:
     632 + i2p_checker = ProxiedAiohttpChecker( # type: ignore
     633 + proxy=i2p_proxy, cookie_jar=cookie_jar, logger=logger
    626 634   )
    627 635   
    628 636   # TODO
    skipped 20 lines
    649 657   '': clearweb_checker,
    650 658   'tor': tor_checker,
    651 659   'dns': dns_checker,
     660 + 'i2p': i2p_checker,
    652 661   }
    653 662   options["parsing"] = is_parsing_enabled
    654 663   options["timeout"] = timeout
    skipped 50 lines
    705 714   await clearweb_checker.close()
    706 715   if tor_proxy:
    707 716   await tor_checker.close()
     717 + if i2p_proxy:
     718 + await i2p_checker.close()
    708 719   
    709 720   # notify caller that all queries are finished
    710 721   query_notify.finish()
    skipped 33 lines
    744 755   db: MaigretDatabase,
    745 756   silent=False,
    746 757   tor_proxy=None,
     758 + i2p_proxy=None,
    747 759  ):
    748 760   changes = {
    749 761   "disabled": False,
    skipped 18 lines
    768 780   no_progressbar=True,
    769 781   retries=1,
    770 782   tor_proxy=tor_proxy,
     783 + i2p_proxy=i2p_proxy,
    771 784   )
    772 785   
    773 786   # don't disable entries with other ids types
    skipped 49 lines
    823 836   silent=False,
    824 837   max_connections=10,
    825 838   tor_proxy=None,
     839 + i2p_proxy=None,
    826 840  ) -> bool:
    827 841   sem = asyncio.Semaphore(max_connections)
    828 842   tasks = []
    skipped 5 lines
    834 848   disabled_old_count = disabled_count(all_sites.values())
    835 849   
    836 850   for _, site in all_sites.items():
    837  - check_coro = site_self_check(site, logger, sem, db, silent, tor_proxy)
     851 + check_coro = site_self_check(
     852 + site, logger, sem, db, silent, tor_proxy, i2p_proxy
     853 + )
    838 854   future = asyncio.ensure_future(check_coro)
    839 855   tasks.append(future)
    840 856   
    skipped 20 lines
  • ■ ■ ■ ■ ■ ■
    maigret/maigret.py
    skipped 246 lines
    247 247   help="Specify URL of your Tor gateway. Default is socks5://127.0.0.1:9050",
    248 248   )
    249 249   parser.add_argument(
     250 + "--i2p-proxy",
     251 + metavar='I2P_PROXY_URL',
     252 + action="store",
     253 + default='http://127.0.0.1:4444',
     254 + help="Specify URL of your I2P gateway. Default is http://127.0.0.1:4444",
     255 + )
     256 + parser.add_argument(
    250 257   "--with-domains",
    251 258   action="store_true",
    252 259   default=False,
    skipped 281 lines
    534 541   logger,
    535 542   max_connections=args.connections,
    536 543   tor_proxy=args.tor_proxy,
     544 + i2p_proxy=args.i2p_proxy,
    537 545   )
    538 546   if is_need_update:
    539 547   if input('Do you want to save changes permanently? [Yn]\n').lower() in (
    skipped 70 lines
    610 618   query_notify=query_notify,
    611 619   proxy=args.proxy,
    612 620   tor_proxy=args.tor_proxy,
     621 + i2p_proxy=args.i2p_proxy,
    613 622   timeout=args.timeout,
    614 623   is_parsing_enabled=parsing_enabled,
    615 624   id_type=id_type,
    skipped 86 lines
  • ■ ■ ■ ■ ■
    maigret/resources/data.json
    skipped 13023 lines
    13024 13024   "us"
    13025 13025   ],
    13026 13026   "headers": {
    13027  - "authorization": "Bearer BQDEpoSTjg2Ko86QUHZjJmZvp5AuI1ru6rJySe8_cD0bRqMZk6PfmdsmJBu3QeiNHgUPGQPDz2VeSvRr16w"
     13027 + "authorization": "Bearer BQCypIuUtz7zDFov8xN86mj1BelLf7Apf9WBaC5yYfNkmGe4r7Hz4Awp6dqPuCAP9K9F5yYtjbyZX_vlr4I"
    13028 13028   },
    13029 13029   "errors": {
    13030 13030   "Spotify is currently not available in your country.": "Access denied in your country, use proxy/vpn"
    skipped 1826 lines
    14857 14857   "video"
    14858 14858   ],
    14859 14859   "headers": {
    14860  - "Authorization": "jwt eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE2MjI2NjM1MjAsInVzZXJfaWQiOm51bGwsImFwcF9pZCI6NTg0NzksInNjb3BlcyI6InB1YmxpYyIsInRlYW1fdXNlcl9pZCI6bnVsbH0.bKcisdrE5nJZMvrbagUC8lZQOs9spg3IKMlK15IclM4"
     14860 + "Authorization": "jwt eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE2MjI2NjcxMjAsInVzZXJfaWQiOm51bGwsImFwcF9pZCI6NTg0NzksInNjb3BlcyI6InB1YmxpYyIsInRlYW1fdXNlcl9pZCI6bnVsbH0.V4VVbLzNwPU21rNP5moSxrPcPw--C7_Qz9VHgcJc1CA"
    14861 14861   },
    14862 14862   "activation": {
    14863 14863   "url": "https://vimeo.com/_rv/viewer",
    skipped 13336 lines
    28200 28200   },
    28201 28201   "tags": [
    28202 28202   "tor"
     28203 + ]
     28204 + },
     28205 + "i2pforum": {
     28206 + "protocol": "i2p",
     28207 + "urlMain": "http://i2pforum.i2p",
     28208 + "usernameClaimed": "zzz",
     28209 + "usernameUnclaimed": "noonewouldeverusethis7",
     28210 + "engine": "phpBB/Search",
     28211 + "tags": [
     28212 + "i2p"
    28203 28213   ]
    28204 28214   },
    28205 28215   "forum.freeton.org": {
    skipped 234 lines
  • ■ ■ ■ ■ ■
    maigret/sites.py
    skipped 65 lines
    66 66   "bookmarks",
    67 67   "design",
    68 68   "tor",
     69 + "i2p",
    69 70  ]
    70 71   
    71 72   
    skipped 238 lines
    310 311   )
    311 312   is_id_type_ok = lambda x: x.type == id_type
    312 313   
    313  - filter_tags_engines_fun = lambda x: not tags or is_engine_ok(x) or is_tags_ok(x) or is_protocol_in_tags(x)
     314 + filter_tags_engines_fun = (
     315 + lambda x: not tags
     316 + or is_engine_ok(x)
     317 + or is_tags_ok(x)
     318 + or is_protocol_in_tags(x)
     319 + )
    314 320   filter_names_fun = lambda x: not names or is_name_ok(x) or is_source_ok(x)
    315 321   
    316 322   filter_fun = (
    skipped 174 lines
  • ■ ■ ■ ■ ■
    tests/test_cli.py
    skipped 32 lines
    33 33   'tags': '',
    34 34   'timeout': 30,
    35 35   'tor_proxy': 'socks5://127.0.0.1:9050',
     36 + 'i2p_proxy': 'http://127.0.0.1:4444',
    36 37   'top_sites': 500,
    37 38   'txt': False,
    38 39   'use_disabled_sites': False,
    skipped 59 lines
Please wait...
Page is in error, reload to recover