Upload 28 files
Browse filesFiles changed (22)
- .env+25-12
- .env-sampleAdded+29
- CHANGELOG.md+643
- Dockerfile+28-30
- comet/api/core.py+29-24
- comet/api/stream.py+459-182
- comet/assets/invalidconfig.mp4Added
- comet/assets/proxylimit.mp4Added
- comet/assets/uncached.mp4Added
- comet/debrid/alldebrid.pyAdded+172
- comet/debrid/debridlink.pyAdded+126
- comet/debrid/manager.py+17-3
- comet/debrid/premiumize.pyAdded+177
- comet/debrid/realdebrid.py+134-32
- comet/debrid/torbox.pyAdded+161
- comet/main.py+34-7
- comet/templates/index.html+794-577
- comet/utils/db.py+12-6
- comet/utils/general.py+658-371
- comet/utils/models.py+107-39
- docker-compose.yamlAdded+14
- pyproject.toml+10-3
12345678910111213141516ADDON_ID=stremio.comet.fast # for StremioADDON_NAME=Comet # for StremioFASTAPI_HOST=0.0.0.0FASTAPI_PORT=8000FASTAPI_WORKERS=1 # remove to destroy CPU -> max performancesDATABASE_PATH=data/comet.db # only change it if you know what it is - folders in path must existCACHE_TTL=86400 # cache duration in secondsDEBRID_PROXY_URL=http://127.0.0.1:1080 # https://github.com/cmj2002/warp-dockerINDEXER_MANAGER_TYPE=jackett # or prowlarrINDEXER_MANAGER_URL=http://82.172.152.9:9117INDEXER_MANAGER_API_KEY=kptut9ad0fqgllyeykn27dhr9p6cd3hqINDEXER_MANAGER_TIMEOUT=60 # maximum time to obtain search results from indexer manager in secondsINDEXER_MANAGER_INDEXERS='["audiences","milkie","pterclub","rutracker","rutracker-ru","scenehd","thepiratebay","torrentleech","totheglory2fa","yourbittorrent"]'GET_TORRENT_TIMEOUT=5 # maximum time to obtain the torrent info hash in secondsZILEAN_URL=None # for DMM search - https://github.com/iPromKnight/zileanCUSTOM_HEADER_HTML=None # only set it if you know what it is1234567891011121314151617181920212223242526272829ADDON_ID=stremio.comet.hy # for StremioADDON_NAME=Help Yourself # for StremioFASTAPI_HOST=0.0.0.0FASTAPI_PORT=3000FASTAPI_WORKERS=1 # remove to destroy CPU -> max performances :DDASHBOARD_ADMIN_PASSWORD=CHANGE_ME # The password to access the dashboard with active connections and soon more...DATABASE_TYPE=sqlite # or postgresql if you know what you're doingDATABASE_URL=username:password@hostname:port # to connect to PostgreSQLDATABASE_PATH=data/comet.db # only change it if you know what it is - folders in path must exist - ignored if PostgreSQL usedCACHE_TTL=86400 # cache duration in secondsDEBRID_PROXY_URL=http://127.0.0.1:1080 # https://github.com/cmj2002/warp-docker to bypass Debrid Services and Torrentio server IP blacklistINDEXER_MANAGER_TYPE=jackett # or prowlarr or None if you want to disable it completely and use Zilean or TorrentioINDEXER_MANAGER_URL=http://23.121.245.187:9117INDEXER_MANAGER_API_KEY=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXINDEXER_MANAGER_TIMEOUT=60 # maximum time to obtain search results from indexer manager in secondsINDEXER_MANAGER_INDEXERS='["1337x","animetosho","btsow","eztv","kickasstorrents-to","kickasstorrents-ws","knaben","nyaasi","subsplease","thepiratebay","therarbg","torlock","torrentproject2","torrentscsv","torrentz2nz","yourbittorrent","yts"]'GET_TORRENT_TIMEOUT=5 # maximum time to obtain the torrent info hash in secondsZILEAN_URL=None # for DMM search - https://github.com/iPromKnight/zilean - ex: http://127.0.0.1:8181ZILEAN_TAKE_FIRST=500 # only change it if you know what it isSCRAPE_TORRENTIO=True # scrape TorrentioSCRAPE_MEDIAFUSION=False # scrape MediaFusion - has better results for Indian contentMEDIAFUSION_URL=https://mediafusion.elfhosted.com # Allows you to scrape custom instances of MediaFusionPROXY_DEBRID_STREAM=False # Proxy Debrid Streams (very useful to use your debrid service on multiple IPs at same time)PROXY_DEBRID_STREAM_PASSWORD=CHANGE_ME # Secret password to enter on configuration page to prevent people from abusing your debrid stream proxyPROXY_DEBRID_STREAM_MAX_CONNECTIONS=100 # IP-Based connection limit for the Debrid Stream ProxyPROXY_DEBRID_STREAM_DEBRID_DEFAULT_SERVICE=realdebrid # if you want your users who use the Debrid Stream Proxy not to have to specify Debrid information, but to use the default one insteadPROXY_DEBRID_STREAM_DEBRID_DEFAULT_APIKEY=CHANGE_ME # if you want your users who use the Debrid Stream Proxy not to have to specify Debrid information, but to use the default one insteadTITLE_MATCH_CHECK=True # disable if you only use Torrentio / MediaFusion and are sure you're only scraping good titles, for example (keep it True if Zilean is enabled)CUSTOM_HEADER_HTML=None # only set it if you know what it is
1234567891011121314151617181920212223242526272829ADDON_ID=stremio.comet.fast # for Stremio
ADDON_NAME=Comet # for Stremio
FASTAPI_HOST=0.0.0.0
FASTAPI_PORT=8000
FASTAPI_WORKERS=1 # remove to destroy CPU -> max performances :D
DASHBOARD_ADMIN_PASSWORD=CHANGE_ME # The password to access the dashboard with active connections and soon more...
DATABASE_TYPE=sqlite # or postgresql if you know what you're doing
DATABASE_URL=username:password@hostname:port # to connect to PostgreSQL
DATABASE_PATH=data/comet.db # only change it if you know what it is - folders in path must exist - ignored if PostgreSQL used
CACHE_TTL=86400 # cache duration in seconds
DEBRID_PROXY_URL=http://127.0.0.1:1080 # https://github.com/cmj2002/warp-docker to bypass Debrid Services and Torrentio server IP blacklist
INDEXER_MANAGER_TYPE=jackett # or prowlarr or None if you want to disable it completely and use Zilean or Torrentio
INDEXER_MANAGER_URL=http://127.0.0.1:9117
INDEXER_MANAGER_API_KEY=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
INDEXER_MANAGER_TIMEOUT=60 # maximum time to obtain search results from indexer manager in seconds
INDEXER_MANAGER_INDEXERS='["EXAMPLE1_CHANGETHIS", "EXAMPLE2_CHANGETHIS"]'
GET_TORRENT_TIMEOUT=5 # maximum time to obtain the torrent info hash in seconds
ZILEAN_URL=None # for DMM search - https://github.com/iPromKnight/zilean - ex: http://127.0.0.1:8181
ZILEAN_TAKE_FIRST=500 # only change it if you know what it is
SCRAPE_TORRENTIO=False # scrape Torrentio
SCRAPE_MEDIAFUSION=False # scrape MediaFusion - has better results for Indian content
MEDIAFUSION_URL=https://mediafusion.elfhosted.com # Allows you to scrape custom instances of MediaFusion
PROXY_DEBRID_STREAM=False # Proxy Debrid Streams (very useful to use your debrid service on multiple IPs at same time)
PROXY_DEBRID_STREAM_PASSWORD=CHANGE_ME # Secret password to enter on configuration page to prevent people from abusing your debrid stream proxy
PROXY_DEBRID_STREAM_MAX_CONNECTIONS=100 # IP-Based connection limit for the Debrid Stream Proxy
PROXY_DEBRID_STREAM_DEBRID_DEFAULT_SERVICE=realdebrid # if you want your users who use the Debrid Stream Proxy not to have to specify Debrid information, but to use the default one instead
PROXY_DEBRID_STREAM_DEBRID_DEFAULT_APIKEY=CHANGE_ME # if you want your users who use the Debrid Stream Proxy not to have to specify Debrid information, but to use the default one instead
TITLE_MATCH_CHECK=True # disable if you only use Torrentio / MediaFusion and are sure you're only scraping good titles, for example (keep it True if Zilean is enabled)
CUSTOM_HEADER_HTML=None # only set it if you know what it is12345# Changelog## [1.3.1](https://github.com/g0ldyy/comet/compare/v1.3.0...v1.3.1) (2024-07-03)123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648# Changelog## [1.33.0](https://github.com/g0ldyy/comet/compare/v1.32.2...v1.33.0) (2024-11-14)### Features* add media fusion hashes ([ece4600](https://github.com/g0ldyy/comet/commit/ece4600ddec3bfc64cd39ce3fdb667b022c2cd35))* custom MediaFusion urls for elfhosted <3 ([bc29eb9](https://github.com/g0ldyy/comet/commit/bc29eb9582dca426ad58cc770f7d7d4d0cd6acd0))### Bug Fixes* add missing env var ([77ef84a](https://github.com/g0ldyy/comet/commit/77ef84a89306fe1bb63dc0178024a6c28fe6c262))* I just want to release ([9bb4a4e](https://github.com/g0ldyy/comet/commit/9bb4a4ecc0c0e9449fc57b37b142025c314c5dda))* update hashinfo ([c15206b](https://github.com/g0ldyy/comet/commit/c15206b4b410fc685fbbcd7f31df574553ca6cd5))## [1.32.2](https://github.com/g0ldyy/comet/compare/v1.32.1...v1.32.2) (2024-10-04)### Bug Fixes* ip debrid ([057126b](https://github.com/g0ldyy/comet/commit/057126bbd00f818075969e5e73eff3e834a8ef1f))* missing year metadata ([4a4dfb6](https://github.com/g0ldyy/comet/commit/4a4dfb68923d4c496b8e837eb3a238d6ba21ae95))* realdebrid ip stuff ([6ee6b92](https://github.com/g0ldyy/comet/commit/6ee6b928a57351a82af284b3c6446bcbf01a8e10))* weird shit ([1176b2a](https://github.com/g0ldyy/comet/commit/1176b2a84233f705033b142b1492c2bdc7da5b77))## [1.32.1](https://github.com/g0ldyy/comet/compare/v1.32.0...v1.32.1) (2024-10-01)### Bug Fixes* title parsing ([732021c](https://github.com/g0ldyy/comet/commit/732021c99b8004192b15d29d5b63a39bce893568))## [1.32.0](https://github.com/g0ldyy/comet/compare/v1.31.4...v1.32.0) (2024-09-18)### Features* autplay ([1147845](https://github.com/g0ldyy/comet/commit/1147845640a628bda61e0355f186d425587cb989))## [1.31.4](https://github.com/g0ldyy/comet/compare/v1.31.3...v1.31.4) (2024-09-17)### Bug Fixes* bye samples ([efcf44d](https://github.com/g0ldyy/comet/commit/efcf44dbdff688031771e6834ca4d3244489fc3c))## [1.31.3](https://github.com/g0ldyy/comet/compare/v1.31.2...v1.31.3) (2024-09-06)### Bug Fixes* latin and spanish separated ([2421667](https://github.com/g0ldyy/comet/commit/24216678b8fca0ab8edd48d239fb772f06712b5f))## [1.31.2](https://github.com/g0ldyy/comet/compare/v1.31.1...v1.31.2) (2024-09-04)### Bug Fixes* fail build ([9e7407d](https://github.com/g0ldyy/comet/commit/9e7407d7ced4a1d570e11c350dd5b6ce4a878db6))## [1.31.1](https://github.com/g0ldyy/comet/compare/v1.31.0...v1.31.1) (2024-09-04)### Bug Fixes* metadata ([23966f2](https://github.com/g0ldyy/comet/commit/23966f22887e1d744f2342a97d7b39652155ddb1))## [1.31.0](https://github.com/g0ldyy/comet/compare/v1.30.1...v1.31.0) (2024-09-01)### Features* realdebrid real ip ([479aa8e](https://github.com/g0ldyy/comet/commit/479aa8e527ebfeec01ffcde5c825b0a5af19538e))## [1.30.1](https://github.com/g0ldyy/comet/compare/v1.30.0...v1.30.1) (2024-08-31)### Bug Fixes* torrentio ([165cb25](https://github.com/g0ldyy/comet/commit/165cb256d2c4e27020eb775d52de299cddbdc0f5))* zilean ([6a272fc](https://github.com/g0ldyy/comet/commit/6a272fcf7638581a171ea7ea20aaa5854c3552cc))## [1.30.0](https://github.com/g0ldyy/comet/compare/v1.29.1...v1.30.0) (2024-08-31)### Features* add multi to languages ([da4d1d7](https://github.com/g0ldyy/comet/commit/da4d1d7cc2a4fc590c6acb0a7c0f43be9fc54568))## [1.29.1](https://github.com/g0ldyy/comet/compare/v1.29.0...v1.29.1) (2024-08-31)### Bug Fixes* improves prowlarr compatibility ([7c0ee96](https://github.com/g0ldyy/comet/commit/7c0ee96dafb4a14db02c66e8cfaf2dd5ac05273c))## [1.29.0](https://github.com/g0ldyy/comet/compare/v1.28.5...v1.29.0) (2024-08-31)### Features* faster than ever, better results ([19f9cc4](https://github.com/g0ldyy/comet/commit/19f9cc48ae83e27b43fdbb8541ec8d6b6f2878df))## [1.28.5](https://github.com/g0ldyy/comet/compare/v1.28.4...v1.28.5) (2024-08-29)### Bug Fixes* debrid download link caching not working in certain case ([271dbb6](https://github.com/g0ldyy/comet/commit/271dbb6f43481c509e7a74018d0c804c263eadcd))## [1.28.4](https://github.com/g0ldyy/comet/compare/v1.28.3...v1.28.4) (2024-08-28)### Bug Fixes* metadata ([809e32b](https://github.com/g0ldyy/comet/commit/809e32bb9c727076be12ab88b073b86213b50e12))## [1.28.3](https://github.com/g0ldyy/comet/compare/v1.28.2...v1.28.3) (2024-08-28)### Bug Fixes* sqlite download_link caching ([34c93c6](https://github.com/g0ldyy/comet/commit/34c93c6d3b0d77a8573e810e1f6cefff71a83e85))## [1.28.2](https://github.com/g0ldyy/comet/compare/v1.28.1...v1.28.2) (2024-08-28)### Bug Fixes* metadata retriever ([8f4e133](https://github.com/g0ldyy/comet/commit/8f4e13392ac65ce6b6d23f26f4bfafb629201574))## [1.28.1](https://github.com/g0ldyy/comet/compare/v1.28.0...v1.28.1) (2024-08-27)### Bug Fixes* typo causing errors ([7584af6](https://github.com/g0ldyy/comet/commit/7584af66dd19d3a2c089f75b9f6cf1646ddbc25c))## [1.28.0](https://github.com/g0ldyy/comet/compare/v1.27.1...v1.28.0) (2024-08-27)### Features* PostgreSQL support ([8f46d7f](https://github.com/g0ldyy/comet/commit/8f46d7f1829148190d27adf0d35ed64bf233d029))## [1.27.1](https://github.com/g0ldyy/comet/compare/v1.27.0...v1.27.1) (2024-08-27)### Bug Fixes* Jinja2 missing sometimes ([11a96b7](https://github.com/g0ldyy/comet/commit/11a96b705b29b7a8dd72d81c6d2f6957360bfea9))* jinja2????? ([55fe625](https://github.com/g0ldyy/comet/commit/55fe625c595ac2b8eea5ac3ee98219bbc6adeddf))## [1.27.0](https://github.com/g0ldyy/comet/compare/v1.26.0...v1.27.0) (2024-08-27)### Features* disable indexer select if indexer manager disabled ([2907a0e](https://github.com/g0ldyy/comet/commit/2907a0e25ca3da405b309e0c90ce7d191e7825f7))## [1.26.0](https://github.com/g0ldyy/comet/compare/v1.25.2...v1.26.0) (2024-08-27)### Features* new admin dashboard for debrid proxy stream + title year check + ip-based max connections for debrid proxy stream ([1d11ac4](https://github.com/g0ldyy/comet/commit/1d11ac46bde0c951ee0c3afa746e83a46bb8474f))### Bug Fixes* remove fullstacksample docker compose as it needs to be changed a lot ([7533ecb](https://github.com/g0ldyy/comet/commit/7533ecb4b08a349b25a1bce2e70b1481fc3407bd))## [1.25.2](https://github.com/g0ldyy/comet/compare/v1.25.1...v1.25.2) (2024-08-16)### Bug Fixes* zilean ([40b62b2](https://github.com/g0ldyy/comet/commit/40b62b29dc351775da3c7d914203579abfede646))## [1.25.1](https://github.com/g0ldyy/comet/compare/v1.25.0...v1.25.1) (2024-08-15)### Bug Fixes* zilean 1.5 ([12a9bc5](https://github.com/g0ldyy/comet/commit/12a9bc59ef545ff2ff86637791609fd8e7ffec57))## [1.25.0](https://github.com/g0ldyy/comet/compare/v1.24.0...v1.25.0) (2024-08-06)### Features* Add metadata to result title ([33f3f96](https://github.com/g0ldyy/comet/commit/33f3f96b8c0d2416c8cdb1db8614970f714708ae))## [1.24.0](https://github.com/g0ldyy/comet/compare/v1.23.2...v1.24.0) (2024-08-05)### Features* custom results title ([fa800ef](https://github.com/g0ldyy/comet/commit/fa800ef6b6a0f8ba91ebe2ebfa21147f9cb667a1))## [1.23.2](https://github.com/g0ldyy/comet/compare/v1.23.1...v1.23.2) (2024-07-29)### Bug Fixes* alldebrid support ([1ea4464](https://github.com/g0ldyy/comet/commit/1ea446471ce7e9673724952a24075e64672d3510))## [1.23.1](https://github.com/g0ldyy/comet/compare/v1.23.0...v1.23.1) (2024-07-24)### Bug Fixes* db error ([d1232ce](https://github.com/g0ldyy/comet/commit/d1232cec61b7ecc7d639098d949dc8696822a274))## [1.23.0](https://github.com/g0ldyy/comet/compare/v1.22.0...v1.23.0) (2024-07-24)### Features* ability to enable/disable title match check (TITLE_MATCH_CHECK env var) ([755c4fb](https://github.com/g0ldyy/comet/commit/755c4fb8d21e74576aa615c7d84b399ebedeb45a))* show language emoji in results ([d9e15e7](https://github.com/g0ldyy/comet/commit/d9e15e7e88244eca1c264221ca71e38b4dab7dbc))## [1.22.0](https://github.com/g0ldyy/comet/compare/v1.21.2...v1.22.0) (2024-07-24)### Features* debrid download links are now cached for 1h (massive speed improvement) ([aab0b91](https://github.com/g0ldyy/comet/commit/aab0b918bd205b668ce15510c13d672efb5ed923))### Bug Fixes* imdb metadata wrong name ([0ecba3e](https://github.com/g0ldyy/comet/commit/0ecba3e64aaf6b3f5dad47f4f5527f0a8732d57a))* torrentio proxy ([b098bb1](https://github.com/g0ldyy/comet/commit/b098bb1ed9a60af89e173c527bf4bb579a91a29c))## [1.21.2](https://github.com/g0ldyy/comet/compare/v1.21.1...v1.21.2) (2024-07-24)### Bug Fixes* revert IMDb metadata bug ([595c2c0](https://github.com/g0ldyy/comet/commit/595c2c0da9f6a94a930e82d1e555cafefa343ad2))## [1.21.1](https://github.com/g0ldyy/comet/compare/v1.21.0...v1.21.1) (2024-07-23)### Bug Fixes* coding blind ([2a5002a](https://github.com/g0ldyy/comet/commit/2a5002a3a134429fb9cffc708ac1973dceff0b40))* IMDb metadata retriever ([914c5d2](https://github.com/g0ldyy/comet/commit/914c5d2d455cc4f12f738a4e3aa014aa816c619b))* not retrieving saved stremio settings if all selected ([42c5863](https://github.com/g0ldyy/comet/commit/42c5863297807f231e04f2eb25510b146c6f789a))* proxy stream ([1ceeff5](https://github.com/g0ldyy/comet/commit/1ceeff57223f521b006b4311c314ed62f56096fe))* try to fix Nvidia shield debrid stream proxying ([bdb22dc](https://github.com/g0ldyy/comet/commit/bdb22dcc63b4ca6fd014faaf287b7d8034093c12))* where is the client ([c532656](https://github.com/g0ldyy/comet/commit/c532656b3bba916a5df8cbdcf306b822ef94a871))## [1.21.0](https://github.com/g0ldyy/comet/compare/v1.20.0...v1.21.0) (2024-07-22)### Features* fetch previous settings from stremio configure ([b42f4fb](https://github.com/g0ldyy/comet/commit/b42f4fbc96622a48f035de10e711bae2c9a9e2d2))* save settings on Stremio configure button ([6dd22cc](https://github.com/g0ldyy/comet/commit/6dd22ccce7858967c287ad028ea011caefffd2af))## [1.20.0](https://github.com/g0ldyy/comet/compare/v1.19.5...v1.20.0) (2024-07-22)### Features* use debrid proxy for torrentio (bypass Cloudflare server IP blacklist) ([5d02247](https://github.com/g0ldyy/comet/commit/5d02247021ca897aa79842bde1bbb56817a58967))## [1.19.5](https://github.com/g0ldyy/comet/compare/v1.19.4...v1.19.5) (2024-07-21)### Bug Fixes* prowlarr indexer ([4003fb4](https://github.com/g0ldyy/comet/commit/4003fb4fc06c70364fb7d64a077a334d303de085))## [1.19.4](https://github.com/g0ldyy/comet/compare/v1.19.3...v1.19.4) (2024-07-21)### Bug Fixes* debrid stream proxy on some devices ([240364b](https://github.com/g0ldyy/comet/commit/240364bd883070cf2556fb2b7bdd89fa4a1230f6))## [1.19.3](https://github.com/g0ldyy/comet/compare/v1.19.2...v1.19.3) (2024-07-21)### Bug Fixes* wtf ([b47676c](https://github.com/g0ldyy/comet/commit/b47676cc86758964bb9feb5a4ebcccc97ae7ef02))## [1.19.2](https://github.com/g0ldyy/comet/compare/v1.19.1...v1.19.2) (2024-07-21)### Bug Fixes* Delete poetry.lock ([833bb33](https://github.com/g0ldyy/comet/commit/833bb332c4b4899372b08007c57db4084752339e))## [1.19.1](https://github.com/g0ldyy/comet/compare/v1.19.0...v1.19.1) (2024-07-21)### Bug Fixes* torrentio cloudflare bypass ([d9c98a7](https://github.com/g0ldyy/comet/commit/d9c98a75cb4e101d00395022549499b9a7d3965b))## [1.19.0](https://github.com/g0ldyy/comet/compare/v1.18.3...v1.19.0) (2024-07-20)### Features* torrentio scraper ([94c21d9](https://github.com/g0ldyy/comet/commit/94c21d962d784405d0c09e2986393b90c497dfd9))### Bug Fixes* add torrentio scraper to features ([27d23a5](https://github.com/g0ldyy/comet/commit/27d23a5fa6bb15a92be61ec7701207554864e422))## [1.18.3](https://github.com/g0ldyy/comet/compare/v1.18.2...v1.18.3) (2024-07-19)### Bug Fixes* slightly improve anime results ([c9f230c](https://github.com/g0ldyy/comet/commit/c9f230c9cb8649dbe5f0dfab923039785b4c885b))## [1.18.2](https://github.com/g0ldyy/comet/compare/v1.18.1...v1.18.2) (2024-07-19)### Bug Fixes* faster debrid file parsing ([bf846fa](https://github.com/g0ldyy/comet/commit/bf846fa8a8d8444d13f404ec1651e7f0d71b4697))## [1.18.1](https://github.com/g0ldyy/comet/compare/v1.18.0...v1.18.1) (2024-07-19)### Bug Fixes* torrents faster ([ef53efe](https://github.com/g0ldyy/comet/commit/ef53efe7337679cc1cf1843d1efa956c09cad62a))## [1.18.0](https://github.com/g0ldyy/comet/compare/v1.17.2...v1.18.0) (2024-07-18)### Features* Kitsu support ([b641c69](https://github.com/g0ldyy/comet/commit/b641c69c04173b82386a4e150fccba2e078a85be))## [1.17.2](https://github.com/g0ldyy/comet/compare/v1.17.1...v1.17.2) (2024-07-18)### Bug Fixes* update manifest for animes support ([8ee3220](https://github.com/g0ldyy/comet/commit/8ee32205f14ad098dc96c1f9aea3f78314807431))## [1.17.1](https://github.com/g0ldyy/comet/compare/v1.17.0...v1.17.1) (2024-07-18)### Bug Fixes* metadata ([81ff5bc](https://github.com/g0ldyy/comet/commit/81ff5bc71b1b8a683f662fa9af7c364cf6046b85))## [1.17.0](https://github.com/g0ldyy/comet/compare/v1.16.0...v1.17.0) (2024-07-18)### Features* error videos added to playback ([83668ea](https://github.com/g0ldyy/comet/commit/83668ea3c15858504dfbb58fae5764995dc30bf9))### Bug Fixes* faster (we title match check before doing the rest) ([19fc235](https://github.com/g0ldyy/comet/commit/19fc235e838bcfb6d3d7e06f95309ff72c491fd5))## [1.16.0](https://github.com/g0ldyy/comet/compare/v1.15.5...v1.16.0) (2024-07-18)### Features* add real torrent_size in results ([33ef5b1](https://github.com/g0ldyy/comet/commit/33ef5b119fa9f01bb914ba969bf19f95b61a761f))* config string now sent to console when copy/install button clicked ([9f46fa9](https://github.com/g0ldyy/comet/commit/9f46fa98ddfdd9a0466f200144cd72dc09a8e160))## [1.15.5](https://github.com/g0ldyy/comet/compare/v1.15.4...v1.15.5) (2024-07-16)### Bug Fixes* prowlarr infoHash ([71738ee](https://github.com/g0ldyy/comet/commit/71738ee3a65115694a219b4e55e645df2ccef138))## [1.15.4](https://github.com/g0ldyy/comet/compare/v1.15.3...v1.15.4) (2024-07-16)### Bug Fixes* I fixed it I think guys ([86ea5d5](https://github.com/g0ldyy/comet/commit/86ea5d5a3d2af47e3698c04f160e195cf8def614))## [1.15.3](https://github.com/g0ldyy/comet/compare/v1.15.2...v1.15.3) (2024-07-16)### Bug Fixes* hope ([0086f3f](https://github.com/g0ldyy/comet/commit/0086f3f90ed31dba29d5e5ad0f6b6451f9144e91))## [1.15.2](https://github.com/g0ldyy/comet/compare/v1.15.1...v1.15.2) (2024-07-15)### Bug Fixes* alldebrid .fr to .com ([22c4445](https://github.com/g0ldyy/comet/commit/22c444573766bba40ac5d40fe83a0bc2fbf04ec3))* int to float ([a0d72d8](https://github.com/g0ldyy/comet/commit/a0d72d8849b289a6f7c7be4e4219a46ccdd82ee2))## [1.15.1](https://github.com/g0ldyy/comet/compare/v1.15.0...v1.15.1) (2024-07-15)### Bug Fixes* do the maths client side ([b0aa42c](https://github.com/g0ldyy/comet/commit/b0aa42c519767b61ed9d3dfdec7eceed79e127ae))## [1.15.0](https://github.com/g0ldyy/comet/compare/v1.14.2...v1.15.0) (2024-07-15)### Features* faster, prowlarr pack support, max size, tracker name in results and more... ([0fabd79](https://github.com/g0ldyy/comet/commit/0fabd79a6e07b33fde76074ebbb5193cea7b9d10))* realTitle in results for prowlarr support ([57440a9](https://github.com/g0ldyy/comet/commit/57440a9d08d2630ed084cfd07b374c9d9a96ef19))### Bug Fixes* valid debrid api key not needed anymore if results already cached ([e94e224](https://github.com/g0ldyy/comet/commit/e94e2249a0ac9bd99eaee1f90dd3cdfd41bc43ba))## [1.14.2](https://github.com/g0ldyy/comet/compare/v1.14.1...v1.14.2) (2024-07-13)### Bug Fixes* divising by 0 ([dcef22a](https://github.com/g0ldyy/comet/commit/dcef22a46d6331befae31d51a977ed714868366f))## [1.14.1](https://github.com/g0ldyy/comet/compare/v1.14.0...v1.14.1) (2024-07-12)### Bug Fixes* speed up playback ([683a826](https://github.com/g0ldyy/comet/commit/683a82656aa35a90a891ef902f59acb967c078e4))## [1.14.0](https://github.com/g0ldyy/comet/compare/v1.13.0...v1.14.0) (2024-07-12)### Features* Debrid-Link support ([dadca78](https://github.com/g0ldyy/comet/commit/dadca784b1ddddbbde1d7db59e2d12039a99f60a))### Bug Fixes* alldebrid get files ([4bf8e88](https://github.com/g0ldyy/comet/commit/4bf8e88c0be7e82349581c8027f4ecb407ec99de))## [1.13.0](https://github.com/g0ldyy/comet/compare/v1.12.4...v1.13.0) (2024-07-11)### Features* torbox integration ([db1a003](https://github.com/g0ldyy/comet/commit/db1a003a7b6225ea06dfd118cb8247dd2b385a1e))### Bug Fixes* torbox faster (removed useless checks) ([dfaf12b](https://github.com/g0ldyy/comet/commit/dfaf12b6afcf7d1aa2d7d998bdf9dedef8ec0502))* torbox ignore empty data ([f971255](https://github.com/g0ldyy/comet/commit/f971255c0f6da4207e015d0a7d779b9a89afdb91))* useless repeated code ([fa8ce05](https://github.com/g0ldyy/comet/commit/fa8ce0546575eb7e93560dc25649ea9620a2e554))## [1.12.4](https://github.com/g0ldyy/comet/compare/v1.12.3...v1.12.4) (2024-07-10)### Bug Fixes* realdebrid pack caching issue ([0a9eb03](https://github.com/g0ldyy/comet/commit/0a9eb03c5895fffaff8f13c6eb96d546487dcccd))## [1.12.3](https://github.com/g0ldyy/comet/compare/v1.12.2...v1.12.3) (2024-07-08)### Bug Fixes* zilean multithreaded ([73b0a35](https://github.com/g0ldyy/comet/commit/73b0a35d38dd29c6b9ba4dad116f8f86f5086064))## [1.12.2](https://github.com/g0ldyy/comet/compare/v1.12.1...v1.12.2) (2024-07-08)### Bug Fixes* lower not needed ([ff60d91](https://github.com/g0ldyy/comet/commit/ff60d91091f465db1c5b06eeb3ad8efd064f2c24))## [1.12.1](https://github.com/g0ldyy/comet/compare/v1.12.0...v1.12.1) (2024-07-08)### Bug Fixes* wrong debrid stream proxy password warning being showed everytime ([0514484](https://github.com/g0ldyy/comet/commit/05144847976207a9780460a92e7c1b1ff20f10f1))## [1.12.0](https://github.com/g0ldyy/comet/compare/v1.11.2...v1.12.0) (2024-07-08)### Features* wrong password warning for debrid stream proxy ([6b8303b](https://github.com/g0ldyy/comet/commit/6b8303b2745bf3191a60f0a9c25d0d2bd81c4436))## [1.11.2](https://github.com/g0ldyy/comet/compare/v1.11.1...v1.11.2) (2024-07-07)### Bug Fixes* prowlarr ([a6179bf](https://github.com/g0ldyy/comet/commit/a6179bf3b029619286edbc1a7746091d0d254d7b))## [1.11.1](https://github.com/g0ldyy/comet/compare/v1.11.0...v1.11.1) (2024-07-07)### Bug Fixes* webui copy button for non secured environments ([8eda672](https://github.com/g0ldyy/comet/commit/8eda6720ff3b27bc748b9329fc0a5442310aa291))## [1.11.0](https://github.com/g0ldyy/comet/compare/v1.10.0...v1.11.0) (2024-07-07)### Features* pack support for alldebrid ([30fe1ef](https://github.com/g0ldyy/comet/commit/30fe1ef6bd97aec5545aa808bf77db9ae4a8d4fa))* zilean only mode ([123378f](https://github.com/g0ldyy/comet/commit/123378ff351ed4b6df15f0a33c6d1227f6f91fc5))### Bug Fixes* zilean filtering speed fixed ([dad68c2](https://github.com/g0ldyy/comet/commit/dad68c256e93df99a3aa5ed810dc495dc67d739d))## [1.10.0](https://github.com/g0ldyy/comet/compare/v1.9.1...v1.10.0) (2024-07-07)### Features* premiumize support ([ab846a7](https://github.com/g0ldyy/comet/commit/ab846a76134fa2c0ebf6091a878bf3f0aeb93ff4))### Bug Fixes* proxy is not needed with premiumize ([82fb354](https://github.com/g0ldyy/comet/commit/82fb354ed10a471f1ac3d9b807af71c1ae6c80de))## [1.9.1](https://github.com/g0ldyy/comet/compare/v1.9.0...v1.9.1) (2024-07-06)### Bug Fixes* easier for elfhosted to process ([6443fa1](https://github.com/g0ldyy/comet/commit/6443fa1b5fe601cbdf27e208bd80feaf3ac3156d))* log error ([9fb92eb](https://github.com/g0ldyy/comet/commit/9fb92eb3780e8b312cdb97dd566f699846eaec4e))## [1.9.0](https://github.com/g0ldyy/comet/compare/v1.8.1...v1.9.0) (2024-07-06)### Features* ui improvements ([9a94f0f](https://github.com/g0ldyy/comet/commit/9a94f0fc272c07185f16ecbb0463335a04b6a77f))## [1.8.1](https://github.com/g0ldyy/comet/compare/v1.8.0...v1.8.1) (2024-07-06)### Bug Fixes* debrid stream proxy dynamic input field ([2e0a219](https://github.com/g0ldyy/comet/commit/2e0a219ca523e4f9f4e1fdd1301e651f2846470e))## [1.8.0](https://github.com/g0ldyy/comet/compare/v1.7.0...v1.8.0) (2024-07-06)### Features* improve debrid stream proxy ([60710fa](https://github.com/g0ldyy/comet/commit/60710faa41d732c441fdd76a03c20b8649c7274d))### Bug Fixes* logs ([8743e49](https://github.com/g0ldyy/comet/commit/8743e4973b0db85d252fca321f04f23f0ca54a55))## [1.7.0](https://github.com/g0ldyy/comet/compare/v1.6.2...v1.7.0) (2024-07-05)### Features* cosmetics + important fixes ([a1441c8](https://github.com/g0ldyy/comet/commit/a1441c8d9a0bc788caad359e823034a709c1cc2c))## [1.6.2](https://github.com/g0ldyy/comet/compare/v1.6.1...v1.6.2) (2024-07-05)### Bug Fixes* I forgot something I need to release for elfhosted bruh ([14d6ebf](https://github.com/g0ldyy/comet/commit/14d6ebf0f43c87d6e199e6fdd57a02bfa6acc973))## [1.6.1](https://github.com/g0ldyy/comet/compare/v1.6.0...v1.6.1) (2024-07-05)### Bug Fixes* alldebrid stream proxy ([1502d4c](https://github.com/g0ldyy/comet/commit/1502d4cf17e785b5972d781a185eda1dade119dd))## [1.6.0](https://github.com/g0ldyy/comet/compare/v1.5.1...v1.6.0) (2024-07-05)### Features* alldebrid support ([afd27c0](https://github.com/g0ldyy/comet/commit/afd27c083da37204797246450619a4f9c1a7fc89))## [1.5.1](https://github.com/g0ldyy/comet/compare/v1.5.0...v1.5.1) (2024-07-05)### Bug Fixes* imdb metadata api returning "Summer Watch Guide" ([e9af38b](https://github.com/g0ldyy/comet/commit/e9af38bdc1c1d0aea225ef10f201658ce4b749c6))## [1.5.0](https://github.com/g0ldyy/comet/compare/v1.4.0...v1.5.0) (2024-07-04)### Features* insane new debrid stream proxy (allows to use debrid service on multiple IPs at same time) ([ba1f78e](https://github.com/g0ldyy/comet/commit/ba1f78eb84fda5e4d3b9f488d5fbde46fa57317d))### Bug Fixes* try to fix session unclosed issue with debrid stream proxy ([1f63113](https://github.com/g0ldyy/comet/commit/1f63113d8d418a8101cea925625f6d1d0cef5cf7))## [1.4.0](https://github.com/g0ldyy/comet/compare/v1.3.3...v1.4.0) (2024-07-04)### Features* add option to toggle title checking ([bbb257d](https://github.com/g0ldyy/comet/commit/bbb257dda87875bfcb0d236d1cd82e9a3781fdef))## [1.3.3](https://github.com/g0ldyy/comet/compare/v1.3.2...v1.3.3) (2024-07-03)### Bug Fixes* 0.30ms faster :pro: ([6b1daa6](https://github.com/g0ldyy/comet/commit/6b1daa61a0106d6557047059348ab6e7caecb693))## [1.3.2](https://github.com/g0ldyy/comet/compare/v1.3.1...v1.3.2) (2024-07-03)### Bug Fixes* only show stars for non mobile users (performance issue) ([7415984](https://github.com/g0ldyy/comet/commit/741598497eedbb4be3c75e89470077e68ed3528d))## [1.3.1](https://github.com/g0ldyy/comet/compare/v1.3.0...v1.3.1) (2024-07-03)
123456789101112131415161718192021222324252627282930FROM python:3.11-alpineLABEL name="Comet" \description="Stremio's fastest torrent/debrid search add-on." \url="https://github.com/g0ldyy/comet"WORKDIR /appARG DATABASE_PATHENV PYTHONUNBUFFERED=1 \PYTHONDONTWRITEBYTECODE=1 \POETRY_NO_INTERACTION=1 \POETRY_HOME="/usr/local" \FORCE_COLOR=1 \TERM=xterm-256color# Fix python-alpine gccRUN apk add --no-cache \gcc \musl-dev \libffi-dev \makeRUN pip install poetryRUN mkdir -p /root/.cache/pypoetry/virtualenvsRUN chmod 777 /root/.cache/pypoetry/virtualenvsCOPY . .RUN poetry install --no-cache --no-root --without devENTRYPOINT ["poetry", "run", "python", "-m", "comet.main"]12345678910111213141516171819202122232425262728FROM python:3.11-alpineLABEL name="Comet" \description="Stremio's fastest torrent/debrid search add-on." \url="https://github.com/g0ldyy/comet"WORKDIR /appARG DATABASE_PATHENV PYTHONUNBUFFERED=1 \PYTHONDONTWRITEBYTECODE=1 \POETRY_NO_INTERACTION=1 \POETRY_HOME="/usr/local" \FORCE_COLOR=1 \TERM=xterm-256color# Fix python-alpine gccRUN apk add --no-cache \gcc \musl-dev \libffi-dev \makeRUN pip install poetryCOPY . .RUN poetry install --no-cache --no-root --without devENTRYPOINT ["poetry", "run", "python", "-m", "comet.main"]
1231 unmodified line567891010 unmodified lines21222324252627282930313233343536373839404142435 unmodified lines4950515253545556575859606162636465666768697071727374import RTNfrom fastapi import APIRouter, Request1 unmodified linefrom fastapi.templating import Jinja2Templatesfrom comet.utils.models import settingstemplates = Jinja2Templates("comet/templates")main = APIRouter()10 unmodified linesindexers = settings.INDEXER_MANAGER_INDEXERSweb_config = {"indexers": [indexer.replace(" ", "_").lower() for indexer in indexers],"languages": [language.replace(" ", "_")for language in RTN.patterns.language_code_mapping.keys()],"resolutions": ["360p","480p","576p","720p","1080p","1440p","2160p","4K","Unknown",],}5 unmodified lines{"request": request,"CUSTOM_HEADER_HTML": settings.CUSTOM_HEADER_HTMLif settings.CUSTOM_HEADER_HTML and settings.CUSTOM_HEADER_HTML != "None"else "","webConfig": web_config,},)@main.get("/manifest.json")@main.get("/{b64config}/manifest.json")async def manifest():return {"id": settings.ADDON_ID,"version": "1.0.0","name": settings.ADDON_NAME,"description": "Stremio's fastest torrent/debrid search add-on.","logo": "https://i.imgur.com/jmVoVMu.jpeg","background": "https://i.imgur.com/WwnXB3k.jpeg","resources": ["stream"],"types": ["movie", "series"],"idPrefixes": ["tt"],"catalogs": [],"behaviorHints": {"configurable": True},}12341 unmodified line678910111210 unmodified lines232425262728293031323334355 unmodified lines414243444546474849505152535455565758596061626364656667686970717273747576777879import PTTimport RTNfrom fastapi import APIRouter, Request1 unmodified linefrom fastapi.templating import Jinja2Templatesfrom comet.utils.models import settingsfrom comet.utils.general import config_check, get_debrid_extensiontemplates = Jinja2Templates("comet/templates")main = APIRouter()10 unmodified linesindexers = settings.INDEXER_MANAGER_INDEXERSlanguages = [language for language in PTT.parse.LANGUAGES_TRANSLATION_TABLE.values()]languages.insert(0, "Multi")web_config = {"indexers": [indexer.replace(" ", "_").lower() for indexer in indexers],"languages": languages,"resolutions": [resolution.value for resolution in RTN.models.Resolution],"resultFormat": ["Title", "Metadata", "Size", "Tracker", "Languages"],}5 unmodified lines{"request": request,"CUSTOM_HEADER_HTML": settings.CUSTOM_HEADER_HTMLif settings.CUSTOM_HEADER_HTMLelse "","webConfig": web_config,"indexerManager": settings.INDEXER_MANAGER_TYPE,"proxyDebridStream": settings.PROXY_DEBRID_STREAM,},)@main.get("/manifest.json")@main.get("/{b64config}/manifest.json")async def manifest(b64config: str = None):config = config_check(b64config)if not config:config = {"debridService": None}debrid_extension = get_debrid_extension(config["debridService"])return {"id": settings.ADDON_ID,"name": f"{settings.ADDON_NAME}{(' | ' + debrid_extension) if debrid_extension is not None else ''}","description": "Stremio's fastest torrent/debrid search add-on.","version": "1.0.0","catalogs": [],"resources": [{"name": "stream","types": ["movie", "series"],"idPrefixes": ["tt", "kitsu"],}],"types": ["movie", "series", "anime", "other"],"logo": "https://i.imgur.com/jmVoVMu.jpeg","background": "https://i.imgur.com/WwnXB3k.jpeg","behaviorHints": {"configurable": True, "configurationRequired": False},}
2 unmodified lines3456789101112131415161718192021222318 unmodified lines42434445464748495051525354555657585960616263646566676869707172737475767778798010 unmodified lines919293949596973 unmodified lines1011021031041051061071081091101111121131141151161171181191201211221231 unmodified line1251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223234 unmodified lines3283293303313323333343353363373383393403413423433443453463473483493503513522 unmodified linesimport jsonimport timeimport aiohttpfrom fastapi import APIRouter, Requestfrom fastapi.responses import RedirectResponsefrom RTN import Torrent, parse, sort_torrents, title_matchfrom comet.debrid.manager import getDebridfrom comet.utils.general import (bytes_to_size,config_check,get_indexer_manager,get_torrent_hash,is_video,translate,get_balanced_hashes,)from comet.utils.logger import loggerfrom comet.utils.models import database, rtn, settings18 unmodified linesconnector = aiohttp.TCPConnector(limit=0)async with aiohttp.ClientSession(connector=connector) as session:debrid = getDebrid(session, config)check_debrid = await debrid.check_premium()if not check_debrid:return {"streams": [{"name": "[⚠️] Comet","title": f"Invalid {config['debridService']} account.","url": "https://comet.fast",}]}season = Noneepisode = Noneif type == "series":info = id.split(":")id = info[0]season = int(info[1])episode = int(info[2])get_metadata = await session.get(f"https://v3.sg.media-imdb.com/suggestion/a/{id}.json")metadata = await get_metadata.json()name = metadata["d"][0]["l"]name = translate(name)logName = nameif type == "series":logName = f"{name} S{season:02d}E{episode:02d}"cache_key = hashlib.md5(json.dumps(10 unmodified linesf"SELECT EXISTS (SELECT 1 FROM cache WHERE cacheKey = '{cache_key}')")if cached[0] != 0:logger.info(f"Cache found for {logName}")timestamp = await database.fetch_one(f"SELECT timestamp FROM cache WHERE cacheKey = '{cache_key}'"3 unmodified linesf"DELETE FROM cache WHERE cacheKey = '{cache_key}'")logger.info(f"Cache expired for {logName}")else:sorted_ranked_files = await database.fetch_one(f"SELECT results FROM cache WHERE cacheKey = '{cache_key}'")sorted_ranked_files = json.loads(sorted_ranked_files[0])balanced_hashes = await get_balanced_hashes(sorted_ranked_files, config)results = []for hash in sorted_ranked_files:for resolution in balanced_hashes:if hash in balanced_hashes[resolution]:results.append({"name": f"[RD⚡] Comet {sorted_ranked_files[hash]['data']['resolution'][0] if len(sorted_ranked_files[hash]['data']['resolution']) > 0 else 'Unknown'}","title": f"{sorted_ranked_files[hash]['data']['title']}\n💾 {bytes_to_size(sorted_ranked_files[hash]['data']['size'])}","url": f"{request.url.scheme}://{request.url.netloc}/{b64config}/playback/{hash}/{sorted_ranked_files[hash]['data']['index']}",})1 unmodified linereturn {"streams": results}else:logger.info(f"No cache found for {logName} with user configuration")indexer_manager_type = settings.INDEXER_MANAGER_TYPElogger.info(f"Start of {indexer_manager_type} search for {logName} with indexers {config['indexers']}")tasks = []tasks.append(get_indexer_manager(session, indexer_manager_type, config["indexers"], name))if type == "series":tasks.append(get_indexer_manager(session,indexer_manager_type,config["indexers"],f"{name} S0{season}E0{episode}",))search_response = await asyncio.gather(*tasks)torrents = []for results in search_response:if results == None:continuefor result in results:torrents.append(result)logger.info(f"{len(torrents)} torrents found for {logName} with {indexer_manager_type}")zilean_hashes_count = 0try:if settings.ZILEAN_URL:get_dmm = await session.post(f"{settings.ZILEAN_URL}/dmm/search", json={"queryText": name})get_dmm = await get_dmm.json()if "status" not in get_dmm:for result in get_dmm:zilean_hashes_count += 1if indexer_manager_type == "jackett":object = {"Title": result["filename"],"InfoHash": result["infoHash"],"zilean": True,}if indexer_manager_type == "prowlarr":object = {"title": result["filename"],"infoHash": result["infoHash"],"zilean": True,}torrents.append(object)logger.info(f"{zilean_hashes_count} torrents found for {logName} with Zilean API")except:logger.warning(f"Exception while getting torrents for {logName} with Zilean API")if len(torrents) == 0:return {"streams": []}tasks = []filtered = 0for torrent in torrents:# Only title match check if from Zileanif "zilean" in torrent:parsed_torrent = parse(torrent["Title"]if indexer_manager_type == "jackett"else torrent["title"])if not title_match(name.lower(), parsed_torrent.parsed_title.lower()):filtered += 1continuetasks.append(get_torrent_hash(session, indexer_manager_type, torrent))logger.info(f"{filtered} filtered torrents from Zilean API for {logName}")torrent_hashes = await asyncio.gather(*tasks)torrent_hashes = list(set([hash for hash in torrent_hashes if hash]))logger.info(f"{len(torrent_hashes)} info hashes found for {logName}")torrent_hashes = list(set([hash for hash in torrent_hashes if hash]))if len(torrent_hashes) == 0:return {"streams": []}tasks = []for hash in torrent_hashes:tasks.append(debrid.check_hash_cache(hash))responses = await asyncio.gather(*tasks)availability = {}for response in responses:if not response:continueavailability.update(await response.json())files = {}for hash, details in availability.items():if "rd" not in details:continueif type == "series":for variants in details["rd"]:for index, file in variants.items():filename = file["filename"]if not is_video(filename):continuefilename_parsed = parse(filename)if (season in filename_parsed.seasonand episode in filename_parsed.episode):files[hash] = {"index": index,"title": filename,"size": file["filesize"],}continuefor variants in details["rd"]:for index, file in variants.items():filename = file["filename"]if not is_video(filename):continuefiles[hash] = {"index": index,"title": filename,"size": file["filesize"],}ranked_files = set()for hash in files:ranked_file = rtn.rank(files[hash]["title"], hash)ranked_files.add(ranked_file)sorted_ranked_files = sort_torrents(ranked_files)logger.info(f"{len(sorted_ranked_files)} cached files found on Real-Debrid for {logName}")if len(sorted_ranked_files) == 0:return {"streams": []}sorted_ranked_files = {key: (value.model_dump() if isinstance(value, Torrent) else value)for key, value in sorted_ranked_files.items()}for hash in sorted_ranked_files: # needed for cachingsorted_ranked_files[hash]["data"]["title"] = files[hash]["title"]sorted_ranked_files[hash]["data"]["size"] = files[hash]["size"]sorted_ranked_files[hash]["data"]["index"] = files[hash]["index"]json_data = json.dumps(sorted_ranked_files).replace("'", "''")await database.execute(f"INSERT OR IGNORE INTO cache (cacheKey, results, timestamp) VALUES ('{cache_key}', '{json_data}', {time.time()})")logger.info(f"Results have been cached for {logName}")balanced_hashes = await get_balanced_hashes(sorted_ranked_files, config)results = []for hash in sorted_ranked_files:for resolution in balanced_hashes:if hash in balanced_hashes[resolution]:results.append({"name": f"[RD⚡] Comet {sorted_ranked_files[hash]['data']['resolution'][0] if len(sorted_ranked_files[hash]['data']['resolution']) > 0 else 'Unknown'}","title": f"{sorted_ranked_files[hash]['data']['title']}\n💾 {bytes_to_size(sorted_ranked_files[hash]['data']['size'])}","url": f"{request.url.scheme}://{request.url.netloc}/{b64config}/playback/{hash}/{sorted_ranked_files[hash]['data']['index']}",})4 unmodified lines@streams.head("/{b64config}/playback/{hash}/{index}")async def playback(b64config: str, hash: str, index: str):config = config_check(b64config)if not config:returnasync with aiohttp.ClientSession() as session:debrid = getDebrid(session, config)download_link = await debrid.generate_download_link(hash, index)return RedirectResponse(download_link, status_code=302)@streams.get("/{b64config}/playback/{hash}/{index}")async def playback(b64config: str, hash: str, index: str):config = config_check(b64config)if not config:returnasync with aiohttp.ClientSession() as session:debrid = getDebrid(session, config)download_link = await debrid.generate_download_link(hash, index)return RedirectResponse(download_link, status_code=302)2 unmodified lines345678910111213141516171819202122232425262728293031323334353618 unmodified lines55565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411510 unmodified lines1261271281291301311323 unmodified lines1361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931 unmodified line1951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504 unmodified lines4554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286292 unmodified linesimport jsonimport timeimport aiohttpimport httpximport uuidimport orjsonfrom fastapi import APIRouter, Requestfrom fastapi.responses import (RedirectResponse,StreamingResponse,FileResponse,Response,)from starlette.background import BackgroundTaskfrom RTN import Torrent, sort_torrentsfrom comet.debrid.manager import getDebridfrom comet.utils.general import (config_check,get_debrid_extension,get_indexer_manager,get_zilean,get_torrentio,get_mediafusion,filter,get_torrent_hash,translate,get_balanced_hashes,format_title,get_client_ip,)from comet.utils.logger import loggerfrom comet.utils.models import database, rtn, settings18 unmodified linesconnector = aiohttp.TCPConnector(limit=0)async with aiohttp.ClientSession(connector=connector) as session:full_id = idseason = Noneepisode = Noneif type == "series":info = id.split(":")id = info[0]season = int(info[1])episode = int(info[2])try:kitsu = Falseif id == "kitsu":kitsu = Trueget_metadata = await session.get(f"https://kitsu.io/api/edge/anime/{season}")metadata = await get_metadata.json()name = metadata["data"]["attributes"]["canonicalTitle"]season = 1year = Noneelse:get_metadata = await session.get(f"https://v3.sg.media-imdb.com/suggestion/a/{id}.json")metadata = await get_metadata.json()element = metadata["d"][0if metadata["d"][0]["id"]not in ["/imdbpicks/summer-watch-guide", "/emmys"]else 1]for element in metadata["d"]:if "/" not in element["id"]:breakname = element["l"]year = element.get("y")except Exception as e:logger.warning(f"Exception while getting metadata for {id}: {e}")return {"streams": [{"name": "[⚠️] Comet","title": f"Can't get metadata for {id}","url": "https://comet.fast",}]}name = translate(name)log_name = nameif type == "series":log_name = f"{name} S0{season}E0{episode}"cache_key = hashlib.md5(json.dumps(10 unmodified linesf"SELECT EXISTS (SELECT 1 FROM cache WHERE cacheKey = '{cache_key}')")if cached[0] != 0:logger.info(f"Cache found for {log_name}")timestamp = await database.fetch_one(f"SELECT timestamp FROM cache WHERE cacheKey = '{cache_key}'"3 unmodified linesf"DELETE FROM cache WHERE cacheKey = '{cache_key}'")logger.info(f"Cache expired for {log_name}")else:sorted_ranked_files = await database.fetch_one(f"SELECT results FROM cache WHERE cacheKey = '{cache_key}'")sorted_ranked_files = json.loads(sorted_ranked_files[0])debrid_extension = get_debrid_extension(config["debridService"])balanced_hashes = get_balanced_hashes(sorted_ranked_files, config)results = []if (config["debridStreamProxyPassword"] != ""and settings.PROXY_DEBRID_STREAMand settings.PROXY_DEBRID_STREAM_PASSWORD!= config["debridStreamProxyPassword"]):results.append({"name": "[⚠️] Comet","title": "Debrid Stream Proxy Password incorrect.\nStreams will not be proxied.","url": "https://comet.fast",})for (hash,hash_data,) in sorted_ranked_files.items():for resolution, hash_list in balanced_hashes.items():if hash in hash_list:data = hash_data["data"]results.append({"name": f"[{debrid_extension}⚡] Comet {data['resolution']}","title": format_title(data, config),"torrentTitle": (data["torrent_title"]if "torrent_title" in dataelse None),"torrentSize": (data["torrent_size"]if "torrent_size" in dataelse None),"url": f"{request.url.scheme}://{request.url.netloc}/{b64config}/playback/{hash}/{data['index']}","behaviorHints": {"filename": data["raw_title"],"bingeGroup": "comet|" + hash,},})1 unmodified linereturn {"streams": results}else:logger.info(f"No cache found for {log_name} with user configuration")if (settings.PROXY_DEBRID_STREAMand settings.PROXY_DEBRID_STREAM_PASSWORD== config["debridStreamProxyPassword"]and config["debridApiKey"] == ""):config["debridService"] = (settings.PROXY_DEBRID_STREAM_DEBRID_DEFAULT_SERVICE)config["debridApiKey"] = settings.PROXY_DEBRID_STREAM_DEBRID_DEFAULT_APIKEYdebrid = getDebrid(session, config, get_client_ip(request))check_premium = await debrid.check_premium()if not check_premium:additional_info = ""if config["debridService"] == "alldebrid":additional_info = "\nCheck your email!"return {"streams": [{"name": "[⚠️] Comet","title": f"Invalid {config['debridService']} account.{additional_info}","url": "https://comet.fast",}]}indexer_manager_type = settings.INDEXER_MANAGER_TYPEsearch_indexer = len(config["indexers"]) != 0torrents = []tasks = []if indexer_manager_type and search_indexer:logger.info(f"Start of {indexer_manager_type} search for {log_name} with indexers {config['indexers']}")search_terms = [name]if type == "series":if not kitsu:search_terms.append(f"{name} S0{season}E0{episode}")else:search_terms.append(f"{name} {episode}")tasks.extend(get_indexer_manager(session, indexer_manager_type, config["indexers"], term)for term in search_terms)else:logger.info(f"No indexer {'manager ' if not indexer_manager_type else ''}{'selected by user' if indexer_manager_type else 'defined'} for {log_name}")if settings.ZILEAN_URL:tasks.append(get_zilean(session, name, log_name, season, episode))if settings.SCRAPE_TORRENTIO:tasks.append(get_torrentio(log_name, type, full_id))if settings.SCRAPE_MEDIAFUSION:tasks.append(get_mediafusion(log_name, type, full_id))search_response = await asyncio.gather(*tasks)for results in search_response:for result in results:torrents.append(result)logger.info(f"{len(torrents)} torrents found for {log_name}"+ (" with "+ ", ".join(partfor part in [indexer_manager_type,"Zilean" if settings.ZILEAN_URL else None,"Torrentio" if settings.SCRAPE_TORRENTIO else None,"MediaFusion" if settings.SCRAPE_MEDIAFUSION else None,]if part)if any([indexer_manager_type,settings.ZILEAN_URL,settings.SCRAPE_TORRENTIO,settings.SCRAPE_MEDIAFUSION,])else ""))if len(torrents) == 0:return {"streams": []}if settings.TITLE_MATCH_CHECK:indexed_torrents = [(i, torrents[i]["Title"]) for i in range(len(torrents))]chunk_size = 50chunks = [indexed_torrents[i : i + chunk_size]for i in range(0, len(indexed_torrents), chunk_size)]tasks = []for chunk in chunks:tasks.append(filter(chunk, name, year))filtered_torrents = await asyncio.gather(*tasks)index_less = 0for result in filtered_torrents:for filtered in result:if not filtered[1]:del torrents[filtered[0] - index_less]index_less += 1continuelogger.info(f"{len(torrents)} torrents passed title match check for {log_name}")if len(torrents) == 0:return {"streams": []}tasks = []for i in range(len(torrents)):tasks.append(get_torrent_hash(session, (i, torrents[i])))torrent_hashes = await asyncio.gather(*tasks)index_less = 0for hash in torrent_hashes:if not hash[1]:del torrents[hash[0] - index_less]index_less += 1continuetorrents[hash[0] - index_less]["InfoHash"] = hash[1]logger.info(f"{len(torrents)} info hashes found for {log_name}")if len(torrents) == 0:return {"streams": []}files = await debrid.get_files([hash[1] for hash in torrent_hashes if hash[1] is not None],type,season,episode,kitsu,)ranked_files = set()for hash in files:try:ranked_file = rtn.rank(files[hash]["title"],hash, # , correct_title=name, remove_trash=True)ranked_files.add(ranked_file)except:passsorted_ranked_files = sort_torrents(ranked_files)len_sorted_ranked_files = len(sorted_ranked_files)logger.info(f"{len_sorted_ranked_files} cached files found on {config['debridService']} for {log_name}")if len_sorted_ranked_files == 0:if config["debridApiKey"] == "realdebrid":return {"streams": [{"name": "[⚠️] Comet","title": f"RealDebrid API is unstable!","url": "https://comet.fast",}]}return {"streams": []}sorted_ranked_files = {key: (value.model_dump() if isinstance(value, Torrent) else value)for key, value in sorted_ranked_files.items()}torrents_by_hash = {torrent["InfoHash"]: torrent for torrent in torrents}for hash in sorted_ranked_files: # needed for cachingsorted_ranked_files[hash]["data"]["title"] = files[hash]["title"]sorted_ranked_files[hash]["data"]["torrent_title"] = torrents_by_hash[hash]["Title"]sorted_ranked_files[hash]["data"]["tracker"] = torrents_by_hash[hash]["Tracker"]sorted_ranked_files[hash]["data"]["size"] = files[hash]["size"]torrent_size = torrents_by_hash[hash]["Size"]sorted_ranked_files[hash]["data"]["torrent_size"] = (torrent_size if torrent_size else files[hash]["size"])sorted_ranked_files[hash]["data"]["index"] = files[hash]["index"]json_data = json.dumps(sorted_ranked_files).replace("'", "''")await database.execute(f"INSERT {'OR IGNORE ' if settings.DATABASE_TYPE == 'sqlite' else ''}INTO cache (cacheKey, results, timestamp) VALUES (:cache_key, :json_data, :timestamp){' ON CONFLICT DO NOTHING' if settings.DATABASE_TYPE == 'postgresql' else ''}",{"cache_key": cache_key, "json_data": json_data, "timestamp": time.time()},)logger.info(f"Results have been cached for {log_name}")debrid_extension = get_debrid_extension(config["debridService"])balanced_hashes = get_balanced_hashes(sorted_ranked_files, config)results = []if (config["debridStreamProxyPassword"] != ""and settings.PROXY_DEBRID_STREAMand settings.PROXY_DEBRID_STREAM_PASSWORD!= config["debridStreamProxyPassword"]):results.append({"name": "[⚠️] Comet","title": "Debrid Stream Proxy Password incorrect.\nStreams will not be proxied.","url": "https://comet.fast",})for hash, hash_data in sorted_ranked_files.items():for resolution, hash_list in balanced_hashes.items():if hash in hash_list:data = hash_data["data"]results.append({"name": f"[{debrid_extension}⚡] Comet {data['resolution']}","title": format_title(data, config),"torrentTitle": data["torrent_title"],"torrentSize": data["torrent_size"],"url": f"{request.url.scheme}://{request.url.netloc}/{b64config}/playback/{hash}/{data['index']}","behaviorHints": {"filename": data["raw_title"],"bingeGroup": "comet|" + hash,},})4 unmodified lines@streams.head("/{b64config}/playback/{hash}/{index}")async def playback(b64config: str, hash: str, index: str):return RedirectResponse("https://stremio.fast", status_code=302)class CustomORJSONResponse(Response):media_type = "application/json"def render(self, content) -> bytes:assert orjson is not None, "orjson must be installed"return orjson.dumps(content, option=orjson.OPT_INDENT_2)@streams.get("/active-connections", response_class=CustomORJSONResponse)async def active_connections(request: Request, password: str):if password != settings.DASHBOARD_ADMIN_PASSWORD:return "Invalid Password"active_connections = await database.fetch_all("SELECT * FROM active_connections")return {"total_connections": len(active_connections),"active_connections": active_connections,}@streams.get("/{b64config}/playback/{hash}/{index}")async def playback(request: Request, b64config: str, hash: str, index: str):config = config_check(b64config)if not config:return FileResponse("comet/assets/invalidconfig.mp4")if (settings.PROXY_DEBRID_STREAMand settings.PROXY_DEBRID_STREAM_PASSWORD == config["debridStreamProxyPassword"]and config["debridApiKey"] == ""):config["debridService"] = settings.PROXY_DEBRID_STREAM_DEBRID_DEFAULT_SERVICEconfig["debridApiKey"] = settings.PROXY_DEBRID_STREAM_DEBRID_DEFAULT_APIKEYasync with aiohttp.ClientSession() as session:# Check for cached download linkcached_link = await database.fetch_one(f"SELECT link, timestamp FROM download_links WHERE debrid_key = '{config['debridApiKey']}' AND hash = '{hash}' AND file_index = '{index}'")current_time = time.time()download_link = Noneif cached_link:link = cached_link["link"]timestamp = cached_link["timestamp"]if current_time - timestamp < 3600:download_link = linkelse:# Cache expired, remove old entryawait database.execute(f"DELETE FROM download_links WHERE debrid_key = '{config['debridApiKey']}' AND hash = '{hash}' AND file_index = '{index}'")ip = get_client_ip(request)if not download_link:debrid = getDebrid(session,config,ipif (not settings.PROXY_DEBRID_STREAMor settings.PROXY_DEBRID_STREAM_PASSWORD!= config["debridStreamProxyPassword"])else "",)download_link = await debrid.generate_download_link(hash, index)if not download_link:return FileResponse("comet/assets/uncached.mp4")# Cache the new download linkawait database.execute(f"INSERT {'OR IGNORE ' if settings.DATABASE_TYPE == 'sqlite' else ''}INTO download_links (debrid_key, hash, file_index, link, timestamp) VALUES (:debrid_key, :hash, :file_index, :link, :timestamp){' ON CONFLICT DO NOTHING' if settings.DATABASE_TYPE == 'postgresql' else ''}",{"debrid_key": config["debridApiKey"],"hash": hash,"file_index": index,"link": download_link,"timestamp": current_time,},)if (settings.PROXY_DEBRID_STREAMand settings.PROXY_DEBRID_STREAM_PASSWORD== config["debridStreamProxyPassword"]):active_ip_connections = await database.fetch_all("SELECT ip, COUNT(*) as connections FROM active_connections GROUP BY ip")if any(connection["ip"] == ipand connection["connections"]>= settings.PROXY_DEBRID_STREAM_MAX_CONNECTIONSfor connection in active_ip_connections):return FileResponse("comet/assets/proxylimit.mp4")proxy = Noneclass Streamer:def __init__(self, id: str):self.id = idself.client = httpx.AsyncClient(proxy=proxy)self.response = Noneasync def stream_content(self, headers: dict):async with self.client.stream("GET", download_link, headers=headers) as self.response:async for chunk in self.response.aiter_raw():yield chunkasync def close(self):await database.execute(f"DELETE FROM active_connections WHERE id = '{self.id}'")if self.response is not None:await self.response.aclose()if self.client is not None:await self.client.aclose()range_header = request.headers.get("range", "bytes=0-")response = await session.head(download_link, headers={"Range": range_header})if response.status == 503 and config["debridService"] == "alldebrid":proxy = (settings.DEBRID_PROXY_URL) # proxy is not needed to proxy realdebrid streamresponse = await session.head(download_link, headers={"Range": range_header}, proxy=proxy)if response.status == 206:id = str(uuid.uuid4())await database.execute(f"INSERT {'OR IGNORE ' if settings.DATABASE_TYPE == 'sqlite' else ''}INTO active_connections (id, ip, content, timestamp) VALUES (:id, :ip, :content, :timestamp){' ON CONFLICT DO NOTHING' if settings.DATABASE_TYPE == 'postgresql' else ''}",{"id": id,"ip": ip,"content": str(response.url),"timestamp": current_time,},)streamer = Streamer(id)return StreamingResponse(streamer.stream_content({"Range": range_header}),status_code=206,headers={"Content-Range": response.headers["Content-Range"],"Content-Length": response.headers["Content-Length"],"Accept-Ranges": "bytes",},background=BackgroundTask(streamer.close),)return FileResponse("comet/assets/uncached.mp4")return RedirectResponse(download_link, status_code=302)
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172import aiohttpimport asyncio
from RTN import parse
from comet.utils.general import is_videofrom comet.utils.logger import loggerfrom comet.utils.models import settings
class AllDebrid: def __init__(self, session: aiohttp.ClientSession, debrid_api_key: str): session.headers["Authorization"] = f"Bearer {debrid_api_key}" self.session = session self.proxy = None
self.api_url = "http://api.alldebrid.com/v4" self.agent = "comet"
async def check_premium(self): try: check_premium = await self.session.get( f"{self.api_url}/user?agent={self.agent}" ) check_premium = await check_premium.text() if '"isPremium":true' in check_premium: return True except Exception as e: logger.warning( f"Exception while checking premium status on All-Debrid: {e}" )
return False
async def get_instant(self, chunk: list): try: get_instant = await self.session.get( f"{self.api_url}/magnet/instant?agent={self.agent}&magnets[]={'&magnets[]='.join(chunk)}" ) return await get_instant.json() except Exception as e: logger.warning( f"Exception while checking hashes instant availability on All-Debrid: {e}" )
async def get_files( self, torrent_hashes: list, type: str, season: str, episode: str, kitsu: bool ): chunk_size = 500 chunks = [ torrent_hashes[i : i + chunk_size] for i in range(0, len(torrent_hashes), chunk_size) ]
tasks = [] for chunk in chunks: tasks.append(self.get_instant(chunk))
responses = await asyncio.gather(*tasks)
availability = [response for response in responses if response]
files = {}
if type == "series": for result in availability: if "status" not in result or result["status"] != "success": continue
for magnet in result["data"]["magnets"]: if not magnet["instant"]: continue
for file in magnet["files"]: filename = file["n"] pack = False if "e" in file: # PACK filename = file["e"][0]["n"] pack = True
if not is_video(filename): continue
if "sample" in filename: continue
filename_parsed = parse(filename) if episode not in filename_parsed.episodes: continue
if kitsu: if filename_parsed.seasons: continue else: if season not in filename_parsed.seasons: continue
files[magnet["hash"]] = { "index": magnet["files"].index(file), "title": filename, "size": file["e"][0]["s"] if pack else file["s"], }
break else: for result in availability: if "status" not in result or result["status"] != "success": continue
for magnet in result["data"]["magnets"]: if not magnet["instant"]: continue
for file in magnet["files"]: filename = file["n"]
if not is_video(filename): continue
if "sample" in filename: continue
files[magnet["hash"]] = { "index": magnet["files"].index(file), "title": filename, "size": file["s"], }
break
return files
async def generate_download_link(self, hash: str, index: str): try: check_blacklisted = await self.session.get( f"{self.api_url}/magnet/upload?agent=comet&magnets[]={hash}" ) check_blacklisted = await check_blacklisted.text() if "NO_SERVER" in check_blacklisted: self.proxy = settings.DEBRID_PROXY_URL if not self.proxy: logger.warning( "All-Debrid blacklisted server's IP. No proxy found." ) else: logger.warning( f"All-Debrid blacklisted server's IP. Switching to proxy {self.proxy} for {hash}|{index}" )
upload_magnet = await self.session.get( f"{self.api_url}/magnet/upload?agent=comet&magnets[]={hash}", proxy=self.proxy, ) upload_magnet = await upload_magnet.json()
get_magnet_status = await self.session.get( f"{self.api_url}/magnet/status?agent=comet&id={upload_magnet['data']['magnets'][0]['id']}", proxy=self.proxy, ) get_magnet_status = await get_magnet_status.json()
unlock_link = await self.session.get( f"{self.api_url}/link/unlock?agent=comet&link={get_magnet_status['data']['magnets']['links'][int(index)]['link']}", proxy=self.proxy, ) unlock_link = await unlock_link.json()
return unlock_link["data"]["link"] except Exception as e: logger.warning( f"Exception while getting download link from All-Debrid for {hash}|{index}: {e}" )123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126import aiohttpimport asyncio
from RTN import parse
from comet.utils.general import is_videofrom comet.utils.logger import logger
class DebridLink: def __init__(self, session: aiohttp.ClientSession, debrid_api_key: str): session.headers["Authorization"] = f"Bearer {debrid_api_key}" self.session = session self.proxy = None
self.api_url = "https://debrid-link.com/api/v2"
async def check_premium(self): try: check_premium = await self.session.get(f"{self.api_url}/account/infos") check_premium = await check_premium.text() if '"accountType":1' in check_premium: return True except Exception as e: logger.warning( f"Exception while checking premium status on Debrid-Link: {e}" )
return False
async def get_instant(self, chunk: list): try: get_instant = await self.session.get( f"{self.api_url}/seedbox/cached?url={','.join(chunk)}" ) return await get_instant.json() except Exception as e: logger.warning( f"Exception while checking hashes instant availability on Debrid-Link: {e}" )
async def get_files( self, torrent_hashes: list, type: str, season: str, episode: str, kitsu: bool ): chunk_size = 250 chunks = [ torrent_hashes[i : i + chunk_size] for i in range(0, len(torrent_hashes), chunk_size) ]
tasks = [] for chunk in chunks: tasks.append(self.get_instant(chunk))
responses = await asyncio.gather(*tasks)
availability = [ response for response in responses if response and response.get("success") ]
files = {}
if type == "series": for result in availability: for hash, torrent_data in result["value"].items(): for file in torrent_data["files"]: filename = file["name"]
if not is_video(filename): continue
if "sample" in filename: continue
filename_parsed = parse(filename) if episode not in filename_parsed.episodes: continue
if kitsu: if filename_parsed.seasons: continue else: if season not in filename_parsed.seasons: continue
files[hash] = { "index": torrent_data["files"].index(file), "title": filename, "size": file["size"], }
break else: for result in availability: for hash, torrent_data in result["value"].items(): for file in torrent_data["files"]: filename = file["name"]
if not is_video(filename): continue
if "sample" in filename: continue
files[hash] = { "index": torrent_data["files"].index(file), "title": filename, "size": file["size"], }
break
return files
async def generate_download_link(self, hash: str, index: str): try: add_torrent = await self.session.post( f"{self.api_url}/seedbox/add", data={"url": hash, "async": True} ) add_torrent = await add_torrent.json()
return add_torrent["value"]["files"][int(index)]["downloadUrl"] except Exception as e: logger.warning( f"Exception while getting download link from Debrid-Link for {hash}|{index}: {e}" )12345678import aiohttpfrom .realdebrid import RealDebriddef getDebrid(session: aiohttp.ClientSession, config: dict):if config["debridService"] == "realdebrid":return RealDebrid(session, config["debridApiKey"])12345678910111213141516171819202122import aiohttpfrom .realdebrid import RealDebridfrom .alldebrid import AllDebridfrom .premiumize import Premiumizefrom .torbox import TorBoxfrom .debridlink import DebridLinkdef getDebrid(session: aiohttp.ClientSession, config: dict, ip: str):debrid_service = config["debridService"]debrid_api_key = config["debridApiKey"]if debrid_service == "realdebrid":return RealDebrid(session, debrid_api_key, ip)elif debrid_service == "alldebrid":return AllDebrid(session, debrid_api_key)elif debrid_service == "premiumize":return Premiumize(session, debrid_api_key)elif debrid_service == "torbox":return TorBox(session, debrid_api_key)elif debrid_service == "debridlink":return DebridLink(session, debrid_api_key)
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177import aiohttpimport asyncio
from RTN import parse
from comet.utils.general import is_videofrom comet.utils.logger import logger
class Premiumize: def __init__(self, session: aiohttp.ClientSession, debrid_api_key: str): self.session = session self.proxy = None
self.api_url = "https://premiumize.me/api" self.debrid_api_key = debrid_api_key
async def check_premium(self): try: check_premium = await self.session.get( f"{self.api_url}/account/info?apikey={self.debrid_api_key}" ) check_premium = await check_premium.text() if ( '"status":"success"' in check_premium and '"premium_until":null' not in check_premium ): return True except Exception as e: logger.warning( f"Exception while checking premium status on Premiumize: {e}" )
return False
async def get_instant(self, chunk: list): try: response = await self.session.get( f"{self.api_url}/cache/check?apikey={self.debrid_api_key}&items[]={'&items[]='.join(chunk)}" )
response = await response.json() response["hashes"] = chunk
return response except Exception as e: logger.warning( f"Exception while checking hash instant availability on Premiumize: {e}" )
async def get_files( self, torrent_hashes: list, type: str, season: str, episode: str, kitsu: bool ): chunk_size = 100 chunks = [ torrent_hashes[i : i + chunk_size] for i in range(0, len(torrent_hashes), chunk_size) ]
tasks = [] for chunk in chunks: tasks.append(self.get_instant(chunk))
responses = await asyncio.gather(*tasks)
availability = [] for response in responses: if not response: continue
availability.append(response)
files = {}
if type == "series": for result in availability: if result["status"] != "success": continue
responses = result["response"] filenames = result["filename"] filesizes = result["filesize"] hashes = result["hashes"] for index, response in enumerate(responses): if not response: continue
if not filesizes[index]: continue
filename = filenames[index]
if "sample" in filename: continue
filename_parsed = parse(filename) if episode not in filename_parsed.episodes: continue
if kitsu: if filename_parsed.seasons: continue else: if season not in filename_parsed.seasons: continue
files[hashes[index]] = { "index": f"{season}|{episode}", "title": filename, "size": int(filesizes[index]), } else: for result in availability: if result["status"] != "success": continue
responses = result["response"] filenames = result["filename"] filesizes = result["filesize"] hashes = result["hashes"] for index, response in enumerate(responses): if response is False: continue
if not filesizes[index]: continue
filename = filenames[index]
if "sample" in filename: continue
files[hashes[index]] = { "index": 0, "title": filename, "size": int(filesizes[index]), }
return files
async def generate_download_link(self, hash: str, index: str): try: add_magnet = await self.session.post( f"{self.api_url}/transfer/directdl?apikey={self.debrid_api_key}&src=magnet:?xt=urn:btih:{hash}", ) add_magnet = await add_magnet.json()
season = None if "|" in index: index = index.split("|") season = int(index[0]) episode = int(index[1])
content = add_magnet["content"] for file in content: filename = file["path"] if "/" in filename: filename = filename.split("/")[1]
if not is_video(filename): content.remove(file) continue
if season is not None: filename_parsed = parse(filename) if ( season in filename_parsed.seasons and episode in filename_parsed.episodes ): return file["link"]
max_size_item = max(content, key=lambda x: x["size"]) return max_size_item["link"] except Exception as e: logger.warning( f"Exception while getting download link from Premiumize for {hash}|{index}: {e}" )123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990import aiohttpfrom comet.utils.logger import loggerfrom comet.utils.models import settingsclass RealDebrid:def __init__(self, session: aiohttp.ClientSession, debrid_api_key: str):session.headers["Authorization"] = f"Bearer {debrid_api_key}"self.session = sessionasync def check_premium(self):try:check_premium = await self.session.get("https://api.real-debrid.com/rest/1.0/user")check_premium = await check_premium.text()if '"type": "premium"' not in check_premium:return Falsereturn Trueexcept Exception as e:logger.warning(f"Exception while checking premium status on Real Debrid: {e}")return Falseasync def check_hash_cache(self, hash: str):try:response = await self.session.get(f"https://api.real-debrid.com/rest/1.0/torrents/instantAvailability/{hash}")return responseexcept Exception as e:logger.warning(f"Exception while checking hash cache on Real Debrid for {hash}: {e}")returnasync def generate_download_link(self, hash: str, index: str):try:check_blacklisted = await self.session.get("https://real-debrid.com/vpn")check_blacklisted = await check_blacklisted.text()proxy = Noneif ("Your ISP or VPN provider IP address is currently blocked on our website"in check_blacklisted):proxy = settings.DEBRID_PROXY_URLif not proxy:logger.warning("Real-Debrid blacklisted server's IP. No proxy found.")else:logger.warning(f"Real-Debrid blacklisted server's IP. Switching to proxy {proxy} for {hash}|{index}")add_magnet = await self.session.post("https://api.real-debrid.com/rest/1.0/torrents/addMagnet",data={"magnet": f"magnet:?xt=urn:btih:{hash}"},proxy=proxy,)add_magnet = await add_magnet.json()get_magnet_info = await self.session.get(add_magnet["uri"], proxy=proxy)get_magnet_info = await get_magnet_info.json()await self.session.post(f"https://api.real-debrid.com/rest/1.0/torrents/selectFiles/{add_magnet['id']}",data={"files": index},proxy=proxy,)get_magnet_info = await self.session.get(add_magnet["uri"], proxy=proxy)get_magnet_info = await get_magnet_info.json()unrestrict_link = await self.session.post("https://api.real-debrid.com/rest/1.0/unrestrict/link",data={"link": get_magnet_info["links"][0]},proxy=proxy,)unrestrict_link = await unrestrict_link.json()return unrestrict_link["download"]except Exception as e:logger.warning(f"Exception while getting download link from Real Debrid for {hash}|{index}: {e}")return "https://comet.fast"123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192import aiohttpimport asynciofrom RTN import parsefrom comet.utils.general import is_videofrom comet.utils.logger import loggerfrom comet.utils.models import settingsclass RealDebrid:def __init__(self, session: aiohttp.ClientSession, debrid_api_key: str, ip: str):session.headers["Authorization"] = f"Bearer {debrid_api_key}"self.session = sessionself.ip = ipself.proxy = Noneself.api_url = "https://api.real-debrid.com/rest/1.0"async def check_premium(self):try:check_premium = await self.session.get(f"{self.api_url}/user")check_premium = await check_premium.text()if '"type": "premium"' in check_premium:return Trueexcept Exception as e:logger.warning(f"Exception while checking premium status on Real-Debrid: {e}")return Falseasync def get_instant(self, chunk: list):try:response = await self.session.get(f"{self.api_url}/torrents/instantAvailability/{'/'.join(chunk)}")return await response.json()except Exception as e:logger.warning(f"Exception while checking hash instant availability on Real-Debrid: {e}")async def get_files(self, torrent_hashes: list, type: str, season: str, episode: str, kitsu: bool):chunk_size = 50chunks = [torrent_hashes[i : i + chunk_size]for i in range(0, len(torrent_hashes), chunk_size)]tasks = []for chunk in chunks:tasks.append(self.get_instant(chunk))responses = await asyncio.gather(*tasks)availability = {}for response in responses:if response is not None:availability.update(response)files = {}if type == "series":for hash, details in availability.items():if "rd" not in details:continuefor variants in details["rd"]:for index, file in variants.items():filename = file["filename"]if not is_video(filename):continueif "sample" in filename:continuefilename_parsed = parse(filename)if episode not in filename_parsed.episodes:continueif kitsu:if filename_parsed.seasons:continueelse:if season not in filename_parsed.seasons:continuefiles[hash] = {"index": index,"title": filename,"size": file["filesize"],}breakelse:for hash, details in availability.items():if "rd" not in details:continuefor variants in details["rd"]:for index, file in variants.items():filename = file["filename"]if not is_video(filename):continueif "sample" in filename:continuefiles[hash] = {"index": index,"title": filename,"size": file["filesize"],}breakreturn filesasync def generate_download_link(self, hash: str, index: str):try:check_blacklisted = await self.session.get("https://real-debrid.com/vpn")check_blacklisted = await check_blacklisted.text()if ("Your ISP or VPN provider IP address is currently blocked on our website"in check_blacklisted):self.proxy = settings.DEBRID_PROXY_URLif not self.proxy:logger.warning("Real-Debrid blacklisted server's IP. No proxy found.")else:logger.warning(f"Real-Debrid blacklisted server's IP. Switching to proxy {self.proxy} for {hash}|{index}")add_magnet = await self.session.post(f"{self.api_url}/torrents/addMagnet",data={"magnet": f"magnet:?xt=urn:btih:{hash}", "ip": self.ip},proxy=self.proxy,)add_magnet = await add_magnet.json()get_magnet_info = await self.session.get(add_magnet["uri"], proxy=self.proxy)get_magnet_info = await get_magnet_info.json()await self.session.post(f"{self.api_url}/torrents/selectFiles/{add_magnet['id']}",data={"files": ",".join(str(file["id"])for file in get_magnet_info["files"]if is_video(file["path"])),"ip": self.ip,},proxy=self.proxy,)get_magnet_info = await self.session.get(add_magnet["uri"], proxy=self.proxy)get_magnet_info = await get_magnet_info.json()index = int(index)realIndex = indexfor file in get_magnet_info["files"]:if file["id"] == realIndex:breakif file["selected"] != 1:index -= 1unrestrict_link = await self.session.post(f"{self.api_url}/unrestrict/link",data={"link": get_magnet_info["links"][index - 1], "ip": self.ip},proxy=self.proxy,)unrestrict_link = await unrestrict_link.json()return unrestrict_link["download"]except Exception as e:logger.warning(f"Exception while getting download link from Real-Debrid for {hash}|{index}: {e}")
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161import aiohttpimport asyncio
from RTN import parse
from comet.utils.general import is_videofrom comet.utils.logger import logger
class TorBox: def __init__(self, session: aiohttp.ClientSession, debrid_api_key: str): session.headers["Authorization"] = f"Bearer {debrid_api_key}" self.session = session self.proxy = None
self.api_url = "https://api.torbox.app/v1/api" self.debrid_api_key = debrid_api_key
async def check_premium(self): try: check_premium = await self.session.get( f"{self.api_url}/user/me?settings=false" ) check_premium = await check_premium.text() if '"success":true' in check_premium and '"plan":0' not in check_premium: return True except Exception as e: logger.warning(f"Exception while checking premium status on TorBox: {e}")
return False
async def get_instant(self, chunk: list): try: response = await self.session.get( f"{self.api_url}/torrents/checkcached?hash={','.join(chunk)}&format=list&list_files=true" ) return await response.json() except Exception as e: logger.warning( f"Exception while checking hash instant availability on TorBox: {e}" )
async def get_files( self, torrent_hashes: list, type: str, season: str, episode: str, kitsu: bool ): chunk_size = 100 chunks = [ torrent_hashes[i : i + chunk_size] for i in range(0, len(torrent_hashes), chunk_size) ]
tasks = [] for chunk in chunks: tasks.append(self.get_instant(chunk))
responses = await asyncio.gather(*tasks)
availability = [response for response in responses if response is not None]
files = {}
if type == "series": for result in availability: if not result["success"] or not result["data"]: continue
for torrent in result["data"]: torrent_files = torrent["files"] for file in torrent_files: filename = file["name"].split("/")[1]
if not is_video(filename): continue
if "sample" in filename: continue
filename_parsed = parse(filename) if episode not in filename_parsed.episodes: continue
if kitsu: if filename_parsed.seasons: continue else: if season not in filename_parsed.seasons: continue
files[torrent["hash"]] = { "index": torrent_files.index(file), "title": filename, "size": file["size"], }
break else: for result in availability: if not result["success"] or not result["data"]: continue
for torrent in result["data"]: torrent_files = torrent["files"] for file in torrent_files: filename = file["name"].split("/")[1]
if not is_video(filename): continue
if "sample" in filename: continue
files[torrent["hash"]] = { "index": torrent_files.index(file), "title": filename, "size": file["size"], }
break
return files
async def generate_download_link(self, hash: str, index: str): try: get_torrents = await self.session.get( f"{self.api_url}/torrents/mylist?bypass_cache=true" ) get_torrents = await get_torrents.json() exists = False for torrent in get_torrents["data"]: if torrent["hash"] == hash: torrent_id = torrent["id"] exists = True break if not exists: create_torrent = await self.session.post( f"{self.api_url}/torrents/createtorrent", data={"magnet": f"magnet:?xt=urn:btih:{hash}"}, ) create_torrent = await create_torrent.json() torrent_id = create_torrent["data"]["torrent_id"]
# get_torrents = await self.session.get( # f"{self.api_url}/torrents/mylist?bypass_cache=true" # ) # get_torrents = await get_torrents.json()
# for torrent in get_torrents["data"]: # if torrent["id"] == torrent_id: # file_id = torrent["files"][int(index)]["id"] # Useless, we already have file index
get_download_link = await self.session.get( f"{self.api_url}/torrents/requestdl?token={self.debrid_api_key}&torrent_id={torrent_id}&file_id={index}&zip=false", ) get_download_link = await get_download_link.json()
return get_download_link["data"] except Exception as e: logger.warning( f"Exception while getting download link from TorBox for {hash}|{index}: {e}" )101 unmodified lines1021031041051061076 unmodified lines114115116117118119120121122123124125126127128129130131132101 unmodified linesapp,host=settings.FASTAPI_HOST,port=settings.FASTAPI_PORT,workers=settings.FASTAPI_WORKERS,log_config=None,)6 unmodified linesf"Server started on http://{settings.FASTAPI_HOST}:{settings.FASTAPI_PORT} - {settings.FASTAPI_WORKERS} workers",)logger.log("COMET", f"Database: {settings.DATABASE_PATH} - TTL: {settings.CACHE_TTL}s")logger.log("COMET", f"Debrid Proxy: {settings.DEBRID_PROXY_URL}")logger.log("COMET",f"Indexer Manager: {settings.INDEXER_MANAGER_TYPE}|{settings.INDEXER_MANAGER_URL} - Timeout: {settings.INDEXER_MANAGER_TIMEOUT}s",)logger.log("COMET", f"Indexers: {settings.INDEXER_MANAGER_INDEXERS}")logger.log("COMET", f"Get Torrent Timeout: {settings.GET_TORRENT_TIMEOUT}s")logger.log("COMET", f"Zilean API: {settings.ZILEAN_URL}")logger.log("COMET", f"Custom Header HTML Enabled: {bool(settings.CUSTOM_HEADER_HTML)}")with server.run_in_thread():101 unmodified lines1021031041051061071081096 unmodified lines116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159101 unmodified linesapp,host=settings.FASTAPI_HOST,port=settings.FASTAPI_PORT,proxy_headers=True,forwarded_allow_ips="*",workers=settings.FASTAPI_WORKERS,log_config=None,)6 unmodified linesf"Server started on http://{settings.FASTAPI_HOST}:{settings.FASTAPI_PORT} - {settings.FASTAPI_WORKERS} workers",)logger.log("COMET",f"Dashboard Admin Password: {settings.DASHBOARD_ADMIN_PASSWORD} - http://{settings.FASTAPI_HOST}:{settings.FASTAPI_PORT}/active-connections?password={settings.DASHBOARD_ADMIN_PASSWORD}",)logger.log("COMET",f"Database ({settings.DATABASE_TYPE}): {settings.DATABASE_PATH if settings.DATABASE_TYPE == 'sqlite' else settings.DATABASE_URL} - TTL: {settings.CACHE_TTL}s",)logger.log("COMET", f"Debrid Proxy: {settings.DEBRID_PROXY_URL}")if settings.INDEXER_MANAGER_TYPE:logger.log("COMET",f"Indexer Manager: {settings.INDEXER_MANAGER_TYPE}|{settings.INDEXER_MANAGER_URL} - Timeout: {settings.INDEXER_MANAGER_TIMEOUT}s",)logger.log("COMET", f"Indexers: {', '.join(settings.INDEXER_MANAGER_INDEXERS)}")logger.log("COMET", f"Get Torrent Timeout: {settings.GET_TORRENT_TIMEOUT}s")else:logger.log("COMET", "Indexer Manager: False")if settings.ZILEAN_URL:logger.log("COMET",f"Zilean: {settings.ZILEAN_URL} - Take first: {settings.ZILEAN_TAKE_FIRST}",)else:logger.log("COMET", "Zilean: False")logger.log("COMET", f"Torrentio Scraper: {bool(settings.SCRAPE_TORRENTIO)}")mediafusion_url = f" - {settings.MEDIAFUSION_URL}"logger.log("COMET", f"MediaFusion Scraper: {bool(settings.SCRAPE_MEDIAFUSION)}{mediafusion_url if settings.SCRAPE_MEDIAFUSION else ''}")logger.log("COMET",f"Debrid Stream Proxy: {bool(settings.PROXY_DEBRID_STREAM)} - Password: {settings.PROXY_DEBRID_STREAM_PASSWORD} - Max Connections: {settings.PROXY_DEBRID_STREAM_MAX_CONNECTIONS} - Default Debrid Service: {settings.PROXY_DEBRID_STREAM_DEBRID_DEFAULT_SERVICE} - Default Debrid API Key: {settings.PROXY_DEBRID_STREAM_DEBRID_DEFAULT_APIKEY}",)logger.log("COMET", f"Title Match Check: {bool(settings.TITLE_MATCH_CHECK)}")logger.log("COMET", f"Custom Header HTML: {bool(settings.CUSTOM_HEADER_HTML)}")with server.run_in_thread():
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577<!DOCTYPE html><html class="sl-theme-dark"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><meta content="Comet" property="og:title" /><meta content="Stremio's fastest torrent/debrid search add-on." property="og:description" /><meta content="https://comet.fast" property="og:url" /><meta content="https://i.imgur.com/jmVoVMu.jpeg" property="og:image" /><meta content="#6b6ef8" data-react-helmet="true" name="theme-color" /><title>Comet - Stremio's fastest torrent/debrid search add-on.</title><link id="favicon" rel="icon" type="image/x-icon" href="https://i.imgur.com/jmVoVMu.jpeg"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.15.1/cdn/themes/dark.css" /><script type="module" src="https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.15.1/cdn/shoelace-autoloader.js"></script><style>:not(:defined) {visibility: hidden;}body {opacity: 0;display: flex;flex-direction: column;justify-content: center;align-items: center;min-height: 100vh;margin: 0;background: radial-gradient(ellipse at bottom, #25292c 0%, #0c0d13 100%);font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";font-size: 1rem;font-weight: 400;}body.ready {opacity: 1;transition: 0.25s opacity;}::-webkit-scrollbar {overflow: hidden;}.header {text-align: center;width: 40%;margin-bottom: 20px;}.comet-text {font-size: calc(1.375rem + 1.5vw);font-weight: 500;margin-bottom: 0;}.form-container {background-color: #1a1d20;padding: 2rem;border-radius: 0.375rem;box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);width: 50%;margin-bottom: 50px;}.form-item {margin-bottom: 0.75rem;}.centered-item {display: flex;justify-content: center;}.stars {position: fixed;top: 0;left: 0;width: 100%;height: 120%;transform: rotate(-45deg);z-index: -1;}.star {--star-color: var(--primary-color);--star-tail-length: 6em;--star-tail-height: 2px;--star-width: calc(var(--star-tail-length) / 6);--fall-duration: 9s;--tail-fade-duration: var(--fall-duration);position: absolute;top: var(--top-offset);left: 0;width: var(--star-tail-length);height: var(--star-tail-height);color: var(--star-color);background: linear-gradient(45deg, currentColor, transparent);border-radius: 50%;filter: drop-shadow(0 0 6px currentColor);transform: translate3d(104em, 0, 0);animation: fall var(--fall-duration) var(--fall-delay) linear infinite, tail-fade var(--tail-fade-duration) var(--fall-delay) ease-out infinite;}@media screen and (max-width: 750px) {.star {animation: fall var(--fall-duration) var(--fall-delay) linear infinite;}}.star:nth-child(1) {--star-tail-length: 6.14em;--top-offset: 3.64vh;--fall-duration: 10.878s;--fall-delay: 0.034s;}.star:nth-child(2) {--star-tail-length: 5.08em;--top-offset: 69.69vh;--fall-duration: 11.372s;--fall-delay: 1.679s;}.star:nth-child(3) {--star-tail-length: 6.1em;--top-offset: 64.3vh;--fall-duration: 7.088s;--fall-delay: 3.382s;}.star:nth-child(4) {--star-tail-length: 6.66em;--top-offset: 34.91vh;--fall-duration: 6.184s;--fall-delay: 9.61s;}.star:nth-child(5) {--star-tail-length: 6.89em;--top-offset: 24.92vh;--fall-duration: 9.465s;--fall-delay: 9.12s;}.star:nth-child(6) {--star-tail-length: 6.5em;--top-offset: 51.9vh;--fall-duration: 10.52s;--fall-delay: 0.214s;}.star:nth-child(7) {--star-tail-length: 5.58em;--top-offset: 24.15vh;--fall-duration: 8.9s;--fall-delay: 0.499s;}.star:nth-child(8) {--star-tail-length: 6.26em;--top-offset: 59.4vh;--fall-duration: 7.671s;--fall-delay: 1.694s;}.star:nth-child(9) {--star-tail-length: 6.46em;--top-offset: 54.52vh;--fall-duration: 6.484s;--fall-delay: 4.616s;}.star:nth-child(10) {--star-tail-length: 5.34em;--top-offset: 74.03vh;--fall-duration: 8.565s;--fall-delay: 1.159s;}.star:nth-child(11) {--star-tail-length: 6.84em;--top-offset: 90.94vh;--fall-duration: 10.133s;--fall-delay: 6.108s;}.star:nth-child(12) {--star-tail-length: 5.48em;--top-offset: 97.27vh;--fall-duration: 10.248s;--fall-delay: 4.186s;}.star:nth-child(13) {--star-tail-length: 7.21em;--top-offset: 17.75vh;--fall-duration: 10.549s;--fall-delay: 1.868s;}.star:nth-child(14) {--star-tail-length: 6.35em;--top-offset: 94.98vh;--fall-duration: 9.682s;--fall-delay: 9.327s;}.star:nth-child(15) {--star-tail-length: 5.18em;--top-offset: 52.87vh;--fall-duration: 9.934s;--fall-delay: 8.919s;}.star:nth-child(16) {--star-tail-length: 5.07em;--top-offset: 50.26vh;--fall-duration: 11.826s;--fall-delay: 8.478s;}.star:nth-child(17) {--star-tail-length: 7.01em;--top-offset: 85.73vh;--fall-duration: 9.87s;--fall-delay: 1.206s;}.star:nth-child(18) {--star-tail-length: 6.39em;--top-offset: 2.81vh;--fall-duration: 10.292s;--fall-delay: 4.394s;}.star:nth-child(19) {--star-tail-length: 5.27em;--top-offset: 56.83vh;--fall-duration: 8.944s;--fall-delay: 8.779s;}.star:nth-child(20) {--star-tail-length: 6.07em;--top-offset: 54.55vh;--fall-duration: 9.324s;--fall-delay: 7.375s;}.star:nth-child(21) {--star-tail-length: 6.1em;--top-offset: 87.67vh;--fall-duration: 11.943s;--fall-delay: 6.919s;}.star:nth-child(22) {--star-tail-length: 5.98em;--top-offset: 70.04vh;--fall-duration: 9.995s;--fall-delay: 4.472s;}.star:nth-child(23) {--star-tail-length: 6.34em;--top-offset: 77.19vh;--fall-duration: 10.073s;--fall-delay: 8.354s;}.star:nth-child(24) {--star-tail-length: 6.95em;--top-offset: 14.48vh;--fall-duration: 9.028s;--fall-delay: 7.638s;}.star:nth-child(25) {--star-tail-length: 6.23em;--top-offset: 8.48vh;--fall-duration: 7.427s;--fall-delay: 0.915s;}.star:nth-child(26) {--star-tail-length: 5.09em;--top-offset: 6.56vh;--fall-duration: 7.706s;--fall-delay: 2.841s;}.star:nth-child(27) {--star-tail-length: 7.01em;--top-offset: 92.85vh;--fall-duration: 7.359s;--fall-delay: 7.229s;}.star:nth-child(28) {--star-tail-length: 5.49em;--top-offset: 27.89vh;--fall-duration: 10.344s;--fall-delay: 2.346s;}.star:nth-child(29) {--star-tail-length: 5.82em;--top-offset: 56.08vh;--fall-duration: 10.911s;--fall-delay: 4.231s;}.star:nth-child(30) {--star-tail-length: 7.24em;--top-offset: 22.54vh;--fall-duration: 9.344s;--fall-delay: 2.112s;}.star:nth-child(31) {--star-tail-length: 6.8em;--top-offset: 59.49vh;--fall-duration: 7.059s;--fall-delay: 0.924s;}.star:nth-child(32) {--star-tail-length: 5.22em;--top-offset: 44.01vh;--fall-duration: 10.121s;--fall-delay: 0.591s;}.star:nth-child(33) {--star-tail-length: 6.1em;--top-offset: 78.61vh;--fall-duration: 8.306s;--fall-delay: 4.403s;}.star:nth-child(34) {--star-tail-length: 7.26em;--top-offset: 85.76vh;--fall-duration: 7.058s;--fall-delay: 6.772s;}.star:nth-child(35) {--star-tail-length: 7.01em;--top-offset: 77.17vh;--fall-duration: 6.29s;--fall-delay: 1.468s;}.star:nth-child(36) {--star-tail-length: 5.17em;--top-offset: 13.63vh;--fall-duration: 6.739s;--fall-delay: 0.019s;}.star:nth-child(37) {--star-tail-length: 6.41em;--top-offset: 70.18vh;--fall-duration: 6.177s;--fall-delay: 8.148s;}.star:nth-child(38) {--star-tail-length: 5.32em;--top-offset: 62.65vh;--fall-duration: 10.476s;--fall-delay: 0.98s;}.star:nth-child(39) {--star-tail-length: 7.24em;--top-offset: 66.12vh;--fall-duration: 8.449s;--fall-delay: 4.255s;}.star:nth-child(40) {--star-tail-length: 6.73em;--top-offset: 14.73vh;--fall-duration: 9.857s;--fall-delay: 6.867s;}.star:nth-child(41) {--star-tail-length: 5.25em;--top-offset: 45.23vh;--fall-duration: 7.898s;--fall-delay: 4.966s;}.star:nth-child(42) {--star-tail-length: 6.73em;--top-offset: 36.17vh;--fall-duration: 7.32s;--fall-delay: 3.93s;}.star:nth-child(43) {--star-tail-length: 7.38em;--top-offset: 83.09vh;--fall-duration: 7.394s;--fall-delay: 5.388s;}.star:nth-child(44) {--star-tail-length: 5.18em;--top-offset: 98.36vh;--fall-duration: 6.905s;--fall-delay: 2.771s;}.star:nth-child(45) {--star-tail-length: 6.66em;--top-offset: 27.99vh;--fall-duration: 7.62s;--fall-delay: 3.624s;}.star:nth-child(46) {--star-tail-length: 5.19em;--top-offset: 92vh;--fall-duration: 9.158s;--fall-delay: 1.984s;}.star:nth-child(47) {--star-tail-length: 6.16em;--top-offset: 2.87vh;--fall-duration: 9.266s;--fall-delay: 4.04s;}.star:nth-child(48) {--star-tail-length: 6.34em;--top-offset: 19.39vh;--fall-duration: 7.503s;--fall-delay: 0.045s;}.star:nth-child(49) {--star-tail-length: 6.85em;--top-offset: 79.92vh;--fall-duration: 7.472s;--fall-delay: 1.514s;}.star:nth-child(50) {--star-tail-length: 7.35em;--top-offset: 63.71vh;--fall-duration: 8.117s;--fall-delay: 4.46s;}.star::before, .star::after {position: absolute;content: "";top: 0;left: calc(var(--star-width) / -2);width: var(--star-width);height: 100%;background: linear-gradient(45deg, transparent, currentColor, transparent);border-radius: inherit;animation: blink 2s linear infinite;}.star::before {transform: rotate(45deg);}.star::after {transform: rotate(-45deg);}@keyframes fall {to {transform: translate3d(-30em, 0, 0);}}@keyframes tail-fade {0%, 50% {width: var(--star-tail-length);opacity: 1;}70%, 80% {width: 0;opacity: 0.4;}100% {width: 0;opacity: 0;}}@keyframes blink {50% {opacity: 0.6;}}</style></head><body><div class="stars"></div><script>document.addEventListener("DOMContentLoaded", function() {const starsContainer = document.querySelector('.stars');const isMobile = window.innerWidth <= 750;const starCount = isMobile ? 30 : 30; // Reduce the number of stars on mobile because of performance issues (currently disabled because we need to find a better workarround)for (let i = 0; i < starCount; i++) {const star = document.createElement("div");star.classList.add("star");starsContainer.appendChild(star);}});</script><div class="header"><p class="comet-text">🚀 Comet - <a href="https://github.com/g0ldyy/comet">GitHub</a></p>{{CUSTOM_HEADER_HTML|safe}}</div><div class="form-container"><div class="form-item"><sl-select id="indexers" multiple clearable label="Indexers" placeholder="Select indexers"></sl-select></div><div class="form-item"><sl-select id="languages" multiple clearable label="Languages" placeholder="Select languages"></sl-select></div><div class="form-item"><sl-select id="resolutions" multiple clearable label="Resolutions" placeholder="Select resolutions"></sl-select></div><div class="form-item"><sl-input id="maxResults" type="number" min=0 value=0 label="Max Results" placeholder="Enter max results"></sl-input></div><div class="form-item"><sl-select id="debridService" value="realdebrid" label="Debrid Service" placeholder="Select debrid service"><sl-option value="realdebrid">Real-Debrid</sl-option></sl-select></div><div class="form-item"><sl-input id="debridApiKey" label="Debrid API Key" placeholder="Enter API key"></sl-input></div><div class="centered-item"><sl-button id="install" variant="neutral">Install</sl-button><sl-alert variant="neutral" duration="3000" closable><sl-icon slot="icon" name="clipboard2-check"></sl-icon><strong>The Stremio addon link has been automatically copied.</strong></sl-alert><script type="module">let defaultLanguages = [];let defaultResolutions = [];document.addEventListener("DOMContentLoaded", async () => {await Promise.allSettled([customElements.whenDefined("sl-button"),customElements.whenDefined("sl-alert"),customElements.whenDefined("sl-select"),customElements.whenDefined("sl-input"),customElements.whenDefined("sl-option"),customElements.whenDefined("sl-icon")]);const webConfig = {{webConfig|tojson}};populateSelect("indexers", webConfig.indexers);populateSelect("languages", webConfig.languages);populateSelect("resolutions", webConfig.resolutions);document.body.classList.add("ready");defaultLanguages = webConfig.languages;defaultResolutions = webConfig.resolutions;});function populateSelect(selectId, options) {const selectElement = document.getElementById(selectId);options.forEach(option => {const optionElement = document.createElement("sl-option");optionElement.value = option;optionElement.textContent = option;selectElement.appendChild(optionElement);});selectElement.value = options;}const button = document.querySelector("sl-button");const alert = document.querySelector('sl-alert[variant="neutral"]');button.addEventListener("click", () => {const debridService = document.getElementById("debridService").value;const debridApiKey = document.getElementById("debridApiKey").value;const indexers = Array.from(document.getElementById("indexers").selectedOptions).map(option => option.value);const languages = Array.from(document.getElementById("languages").selectedOptions).map(option => option.value);const resolutions = Array.from(document.getElementById("resolutions").selectedOptions).map(option => option.value);const maxResults = document.getElementById("maxResults").value;const selectedLanguages = languages.length === defaultLanguages.length && languages.every((val, index) => val === defaultLanguages[index]) ? ["All"] : languages;const selectedResolutions = resolutions.length === defaultResolutions.length && resolutions.every((val, index) => val === defaultResolutions[index]) ? ["All"] : resolutions;const settings = {debridService: debridService,debridApiKey: debridApiKey,indexers: indexers,maxResults: parseInt(maxResults),resolutions: selectedResolutions,languages: selectedLanguages};navigator.clipboard.writeText(`${window.location.origin}/${btoa(JSON.stringify(settings))}/manifest.json`).then(() => {alert.toast();});});</script></div></div></body></html>123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794<!DOCTYPE html><html class="sl-theme-dark"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><meta content="Comet" property="og:title" /><meta content="Stremio's fastest torrent/debrid search add-on." property="og:description" /><meta content="https://comet.fast" property="og:url" /><meta content="https://i.imgur.com/jmVoVMu.jpeg" property="og:image" /><meta content="#6b6ef8" data-react-helmet="true" name="theme-color" /><title>Comet - Stremio's fastest torrent/debrid search add-on.</title><link id="favicon" rel="icon" type="image/x-icon" href="https://i.imgur.com/jmVoVMu.jpeg"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.15.1/cdn/themes/dark.css" /><script type="module" src="https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.15.1/cdn/shoelace-autoloader.js"></script><style>:not(:defined) {visibility: hidden;}body {opacity: 0;display: flex;flex-direction: column;justify-content: center;align-items: center;min-height: 100vh;margin: 0;background: radial-gradient(ellipse at bottom, #25292c 0%, #0c0d13 100%);font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";font-size: 1rem;font-weight: 400;}body.ready {opacity: 1;transition: 0.25s opacity;}::-webkit-scrollbar {overflow: hidden;}.header {text-align: center;width: 40%;margin-bottom: 20px;}.comet-text {font-size: calc(1.375rem + 1.5vw);font-weight: 500;margin-bottom: 0;}.emoji {width: 1em;height: 1em;vertical-align: middle;}.form-container {background-color: #1a1d20;padding: 2rem;border-radius: 0.375rem;box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);width: 80vw;max-width: 950px;margin-bottom: 50px;}.form-item {margin-bottom: 0.75rem;}sl-details {margin-bottom: 0.75rem;}.centered-item {display: flex;justify-content: center;}.margin-left-install {margin-right: 10px;}.stars {position: fixed;top: 0;left: 0;width: 100%;height: 120%;transform: rotate(-45deg);z-index: -1;}.star {--star-color: var(--primary-color);--star-tail-length: 6em;--star-tail-height: 2px;--star-width: calc(var(--star-tail-length) / 6);--fall-duration: 9s;--tail-fade-duration: var(--fall-duration);position: absolute;top: var(--top-offset);left: 0;width: var(--star-tail-length);height: var(--star-tail-height);color: var(--star-color);background: linear-gradient(45deg, currentColor, transparent);border-radius: 50%;filter: drop-shadow(0 0 6px currentColor);transform: translate3d(104em, 0, 0);animation: fall var(--fall-duration) var(--fall-delay) linear infinite, tail-fade var(--tail-fade-duration) var(--fall-delay) ease-out infinite;}@media screen and (max-width: 750px) {.star {animation: fall var(--fall-duration) var(--fall-delay) linear infinite;}}.star:nth-child(1) {--star-tail-length: 6.14em;--top-offset: 3.64vh;--fall-duration: 10.878s;--fall-delay: 0.034s;}.star:nth-child(2) {--star-tail-length: 5.08em;--top-offset: 69.69vh;--fall-duration: 11.372s;--fall-delay: 1.679s;}.star:nth-child(3) {--star-tail-length: 6.1em;--top-offset: 64.3vh;--fall-duration: 7.088s;--fall-delay: 3.382s;}.star:nth-child(4) {--star-tail-length: 6.66em;--top-offset: 34.91vh;--fall-duration: 6.184s;--fall-delay: 9.61s;}.star:nth-child(5) {--star-tail-length: 6.89em;--top-offset: 24.92vh;--fall-duration: 9.465s;--fall-delay: 9.12s;}.star:nth-child(6) {--star-tail-length: 6.5em;--top-offset: 51.9vh;--fall-duration: 10.52s;--fall-delay: 0.214s;}.star:nth-child(7) {--star-tail-length: 5.58em;--top-offset: 24.15vh;--fall-duration: 8.9s;--fall-delay: 0.499s;}.star:nth-child(8) {--star-tail-length: 6.26em;--top-offset: 59.4vh;--fall-duration: 7.671s;--fall-delay: 1.694s;}.star:nth-child(9) {--star-tail-length: 6.46em;--top-offset: 54.52vh;--fall-duration: 6.484s;--fall-delay: 4.616s;}.star:nth-child(10) {--star-tail-length: 5.34em;--top-offset: 74.03vh;--fall-duration: 8.565s;--fall-delay: 1.159s;}.star:nth-child(11) {--star-tail-length: 6.84em;--top-offset: 90.94vh;--fall-duration: 10.133s;--fall-delay: 6.108s;}.star:nth-child(12) {--star-tail-length: 5.48em;--top-offset: 97.27vh;--fall-duration: 10.248s;--fall-delay: 4.186s;}.star:nth-child(13) {--star-tail-length: 7.21em;--top-offset: 17.75vh;--fall-duration: 10.549s;--fall-delay: 1.868s;}.star:nth-child(14) {--star-tail-length: 6.35em;--top-offset: 94.98vh;--fall-duration: 9.682s;--fall-delay: 9.327s;}.star:nth-child(15) {--star-tail-length: 5.18em;--top-offset: 52.87vh;--fall-duration: 9.934s;--fall-delay: 8.919s;}.star:nth-child(16) {--star-tail-length: 5.07em;--top-offset: 50.26vh;--fall-duration: 11.826s;--fall-delay: 8.478s;}.star:nth-child(17) {--star-tail-length: 7.01em;--top-offset: 85.73vh;--fall-duration: 9.87s;--fall-delay: 1.206s;}.star:nth-child(18) {--star-tail-length: 6.39em;--top-offset: 2.81vh;--fall-duration: 10.292s;--fall-delay: 4.394s;}.star:nth-child(19) {--star-tail-length: 5.27em;--top-offset: 56.83vh;--fall-duration: 8.944s;--fall-delay: 8.779s;}.star:nth-child(20) {--star-tail-length: 6.07em;--top-offset: 54.55vh;--fall-duration: 9.324s;--fall-delay: 7.375s;}.star:nth-child(21) {--star-tail-length: 6.1em;--top-offset: 87.67vh;--fall-duration: 11.943s;--fall-delay: 6.919s;}.star:nth-child(22) {--star-tail-length: 5.98em;--top-offset: 70.04vh;--fall-duration: 9.995s;--fall-delay: 4.472s;}.star:nth-child(23) {--star-tail-length: 6.34em;--top-offset: 77.19vh;--fall-duration: 10.073s;--fall-delay: 8.354s;}.star:nth-child(24) {--star-tail-length: 6.95em;--top-offset: 14.48vh;--fall-duration: 9.028s;--fall-delay: 7.638s;}.star:nth-child(25) {--star-tail-length: 6.23em;--top-offset: 8.48vh;--fall-duration: 7.427s;--fall-delay: 0.915s;}.star:nth-child(26) {--star-tail-length: 5.09em;--top-offset: 6.56vh;--fall-duration: 7.706s;--fall-delay: 2.841s;}.star:nth-child(27) {--star-tail-length: 7.01em;--top-offset: 92.85vh;--fall-duration: 7.359s;--fall-delay: 7.229s;}.star:nth-child(28) {--star-tail-length: 5.49em;--top-offset: 27.89vh;--fall-duration: 10.344s;--fall-delay: 2.346s;}.star:nth-child(29) {--star-tail-length: 5.82em;--top-offset: 56.08vh;--fall-duration: 10.911s;--fall-delay: 4.231s;}.star:nth-child(30) {--star-tail-length: 7.24em;--top-offset: 22.54vh;--fall-duration: 9.344s;--fall-delay: 2.112s;}.star:nth-child(31) {--star-tail-length: 6.8em;--top-offset: 59.49vh;--fall-duration: 7.059s;--fall-delay: 0.924s;}.star:nth-child(32) {--star-tail-length: 5.22em;--top-offset: 44.01vh;--fall-duration: 10.121s;--fall-delay: 0.591s;}.star:nth-child(33) {--star-tail-length: 6.1em;--top-offset: 78.61vh;--fall-duration: 8.306s;--fall-delay: 4.403s;}.star:nth-child(34) {--star-tail-length: 7.26em;--top-offset: 85.76vh;--fall-duration: 7.058s;--fall-delay: 6.772s;}.star:nth-child(35) {--star-tail-length: 7.01em;--top-offset: 77.17vh;--fall-duration: 6.29s;--fall-delay: 1.468s;}.star:nth-child(36) {--star-tail-length: 5.17em;--top-offset: 13.63vh;--fall-duration: 6.739s;--fall-delay: 0.019s;}.star:nth-child(37) {--star-tail-length: 6.41em;--top-offset: 70.18vh;--fall-duration: 6.177s;--fall-delay: 8.148s;}.star:nth-child(38) {--star-tail-length: 5.32em;--top-offset: 62.65vh;--fall-duration: 10.476s;--fall-delay: 0.98s;}.star:nth-child(39) {--star-tail-length: 7.24em;--top-offset: 66.12vh;--fall-duration: 8.449s;--fall-delay: 4.255s;}.star:nth-child(40) {--star-tail-length: 6.73em;--top-offset: 14.73vh;--fall-duration: 9.857s;--fall-delay: 6.867s;}.star:nth-child(41) {--star-tail-length: 5.25em;--top-offset: 45.23vh;--fall-duration: 7.898s;--fall-delay: 4.966s;}.star:nth-child(42) {--star-tail-length: 6.73em;--top-offset: 36.17vh;--fall-duration: 7.32s;--fall-delay: 3.93s;}.star:nth-child(43) {--star-tail-length: 7.38em;--top-offset: 83.09vh;--fall-duration: 7.394s;--fall-delay: 5.388s;}.star:nth-child(44) {--star-tail-length: 5.18em;--top-offset: 98.36vh;--fall-duration: 6.905s;--fall-delay: 2.771s;}.star:nth-child(45) {--star-tail-length: 6.66em;--top-offset: 27.99vh;--fall-duration: 7.62s;--fall-delay: 3.624s;}.star:nth-child(46) {--star-tail-length: 5.19em;--top-offset: 92vh;--fall-duration: 9.158s;--fall-delay: 1.984s;}.star:nth-child(47) {--star-tail-length: 6.16em;--top-offset: 2.87vh;--fall-duration: 9.266s;--fall-delay: 4.04s;}.star:nth-child(48) {--star-tail-length: 6.34em;--top-offset: 19.39vh;--fall-duration: 7.503s;--fall-delay: 0.045s;}.star:nth-child(49) {--star-tail-length: 6.85em;--top-offset: 79.92vh;--fall-duration: 7.472s;--fall-delay: 1.514s;}.star:nth-child(50) {--star-tail-length: 7.35em;--top-offset: 63.71vh;--fall-duration: 8.117s;--fall-delay: 4.46s;}.star::before, .star::after {position: absolute;content: "";top: 0;left: calc(var(--star-width) / -2);width: var(--star-width);height: 100%;background: linear-gradient(45deg, transparent, currentColor, transparent);border-radius: inherit;animation: blink 2s linear infinite;}.star::before {transform: rotate(45deg);}.star::after {transform: rotate(-45deg);}@keyframes fall {to {transform: translate3d(-30em, 0, 0);}}@keyframes tail-fade {0%, 50% {width: var(--star-tail-length);opacity: 1;}70%, 80% {width: 0;opacity: 0.4;}100% {width: 0;opacity: 0;}}@keyframes blink {50% {opacity: 0.6;}}</style></head><body><div class="stars"></div><script>let hasTouchScreen = false;if ("maxTouchPoints" in navigator) {hasTouchScreen = navigator.maxTouchPoints > 0;} else if ("msMaxTouchPoints" in navigator) {hasTouchScreen = navigator.msMaxTouchPoints > 0;} else {const mQ = matchMedia?.("(pointer:coarse)");if (mQ?.media === "(pointer:coarse)") {hasTouchScreen = !!mQ.matches;} else if ("orientation" in window) {hasTouchScreen = true;} else {const UA = navigator.userAgent;hasTouchScreen =/\b(BlackBerry|webOS|iPhone|IEMobile)\b/i.test(UA) ||/\b(Android|Windows Phone|iPad|iPod)\b/i.test(UA);}}if (!hasTouchScreen) {document.addEventListener("DOMContentLoaded", function() {const starsContainer = document.querySelector('.stars');const starCount = 30for (let i = 0; i < starCount; i++) {const star = document.createElement("div");star.classList.add("star");starsContainer.appendChild(star);}});}</script><div class="header"><p class="comet-text"><img class="emoji" src="https://fonts.gstatic.com/s/e/notoemoji/latest/1f4ab/512.gif">Comet - <a href="https://github.com/g0ldyy/comet">GitHub</a></p>{{CUSTOM_HEADER_HTML|safe}}</div><div class="form-container"><div class="form-item"><sl-select id="indexers" multiple clearable label="Indexers" placeholder="Select indexers" {% if not indexerManager %} disabled {% endif %}></sl-select></div><div class="form-item"><sl-select id="languages" multiple clearable label="Languages" placeholder="Select languages"></sl-select></div><div class="form-item"><sl-select id="resolutions" multiple clearable label="Resolutions" placeholder="Select resolutions"></sl-select></div><div class="form-item"><sl-input id="maxResults" type="number" min=0 value=0 label="Max Results" placeholder="Enter max results"></sl-input></div><div class="form-item"><sl-input id="maxSize" type="number" min=0 value=0 label="Max Size (GB)" placeholder="Enter max size in gigabytes"></sl-input></div><div class="form-item"><sl-input id="debridStreamProxyPassword" label="Debrid Stream Proxy Password" placeholder="{% if not proxyDebridStream %}Configuration required, see docs{% else %}Enter password{% endif %}" help-text="Debrid Stream Proxying allows you to use your Debrid Service from multiple IPs at same time!" {% if not proxyDebridStream %} disabled {% endif %}></sl-input></div><div class="form-item"><sl-select id="debridService" value="realdebrid" label="Debrid Service" placeholder="Select debrid service"><sl-option value="realdebrid">Real-Debrid</sl-option><sl-option value="alldebrid">All-Debrid</sl-option><sl-option value="premiumize">Premiumize</sl-option><sl-option value="torbox">TorBox</sl-option><sl-option value="debridlink">Debrid-Link</sl-option></sl-select></div><div class="form-item"><label for="debridService">Debrid API Key -<a id="apiKeyLink" href="https://real-debrid.com/apitoken" target="_blank">Get It Here</a></label><sl-input id="debridApiKey" placeholder="Enter API key"></sl-input></div><sl-details summary="Advanced Settings"><div class="form-item"><sl-select id="resultFormat" multiple label="Result Format" placeholder="Select what to show in result title" hoist max-options-visible=10></sl-select></div></sl-details><script>document.getElementById("debridService").addEventListener("sl-change", function(event) {const selectedService = event.target.value;const apiKeyLink = document.getElementById("apiKeyLink");if (selectedService === "realdebrid") {apiKeyLink.href = "https://real-debrid.com/apitoken";} else if (selectedService === "alldebrid") {apiKeyLink.href = "https://alldebrid.com/apikeys";} else if (selectedService === "premiumize") {apiKeyLink.href = "https://premiumize.me/account";} else if (selectedService === "torbox") {apiKeyLink.href = "https://torbox.app/settings";} else if (selectedService === "debridlink") {apiKeyLink.href = "https://debrid-link.com/webapp/apikey";}});</script><div class="centered-item"><sl-button id="install" variant="neutral" class="margin-left-install">Install</sl-button><sl-alert id="installAlert" variant="neutral" duration="3000" closable><sl-icon slot="icon" name="clipboard2-check"></sl-icon><strong>Attempting to add the addon to Stremio...</strong></sl-alert><sl-button id="copy-link" variant="neutral">Copy Link</sl-button><sl-alert id="copyAlert" variant="neutral" duration="3000" closable><sl-icon slot="icon" name="clipboard2-check"></sl-icon><strong>The Stremio addon link has been automatically copied.</strong></sl-alert><script type="module">const languagesEmojis = {"Multi": "🌎","English": "🇬🇧","Japanese": "🇯🇵","Chinese": "🇨🇳","Russian": "🇷🇺","Arabic": "🇸🇦","Portuguese": "🇵🇹","Spanish": "🇪🇸","French": "🇫🇷","German": "🇩🇪","Italian": "🇮🇹","Korean": "🇰🇷","Hindi": "🇮🇳","Bengali": "🇧🇩","Punjabi": "🇵🇰","Marathi": "🇮🇳","Gujarati": "🇮🇳","Tamil": "🇮🇳","Telugu": "🇮🇳","Kannada": "🇮🇳","Malayalam": "🇮🇳","Thai": "🇹🇭","Vietnamese": "🇻🇳","Indonesian": "🇮🇩","Turkish": "🇹🇷","Hebrew": "🇮🇱","Persian": "🇮🇷","Ukrainian": "🇺🇦","Greek": "🇬🇷","Lithuanian": "🇱🇹","Latvian": "🇱🇻","Estonian": "🇪🇪","Polish": "🇵🇱","Czech": "🇨🇿","Slovak": "🇸🇰","Hungarian": "🇭🇺","Romanian": "🇷🇴","Bulgarian": "🇧🇬","Serbian": "🇷🇸","Croatian": "🇭🇷","Slovenian": "🇸🇮","Dutch": "🇳🇱","Danish": "🇩🇰","Finnish": "🇫🇮","Swedish": "🇸🇪","Norwegian": "🇳🇴","Malay": "🇲🇾","Latino": "💃🏻",};let defaultLanguages = [];let defaultResolutions = [];let defaultResultFormat = [];document.addEventListener("DOMContentLoaded", async () => {await Promise.allSettled([customElements.whenDefined("sl-button"),customElements.whenDefined("sl-alert"),customElements.whenDefined("sl-select"),customElements.whenDefined("sl-input"),customElements.whenDefined("sl-option"),customElements.whenDefined("sl-icon")]);const webConfig = {{webConfig|tojson}};populateSelect("indexers", webConfig.indexers);populateSelect("languages", webConfig.languages);populateSelect("resolutions", webConfig.resolutions);populateSelect("resultFormat", webConfig.resultFormat);document.body.classList.add("ready");defaultLanguages = webConfig.languages;defaultResolutions = webConfig.resolutions;defaultResultFormat = webConfig.resultFormat;// try populate the form from previous settingstry {const settings = getSettingsFromUrl();if (settings != null) { populateFormFromSettings(settings); }} catch (error) {console.log("Failed to retrieve or parse settings from URL:", error);}});function populateSelect(selectId, options) {const selectElement = document.getElementById(selectId);options.forEach(option => {const optionElement = document.createElement("sl-option");optionElement.value = option;if (selectId === "languages") {// For languages, prepend the flag emoji if it existsconst flag = languagesEmojis[option] || '';optionElement.textContent = `${flag} ${option}`;} else {// For other selects, just use the option text as isoptionElement.textContent = option;}selectElement.appendChild(optionElement);});// Set the default valueselectElement.value = options; // Assuming first option as default}const installButton = document.querySelector("#install");const installAlert = document.querySelector('#installAlert');const copyLinkButton = document.querySelector("#copy-link");const copyAlert = document.querySelector('#copyAlert');function getSettings() {const indexers = Array.from(document.getElementById("indexers").selectedOptions).map(option => option.value);const languages = Array.from(document.getElementById("languages").selectedOptions).map(option => option.value);const resolutions = Array.from(document.getElementById("resolutions").selectedOptions).map(option => option.value);const maxResults = document.getElementById("maxResults").value;const maxSize = document.getElementById("maxSize").value;const resultFormat = Array.from(document.getElementById("resultFormat").selectedOptions).map(option => option.value);const debridService = document.getElementById("debridService").value;const debridApiKey = document.getElementById("debridApiKey").value;const debridStreamProxyPassword = document.getElementById("debridStreamProxyPassword").value;const selectedLanguages = languages.length === defaultLanguages.length && languages.every((val, index) => val === defaultLanguages[index]) ? ["All"] : languages;const selectedResolutions = resolutions.length === defaultResolutions.length && resolutions.every((val, index) => val === defaultResolutions[index]) ? ["All"] : resolutions;const selectedResultFormat = resultFormat.length === defaultResultFormat.length && resultFormat.every((val, index) => val === defaultResultFormat[index]) ? ["All"] : resultFormat;return {indexers: indexers,maxResults: parseInt(maxResults),maxSize: parseFloat(maxSize * 1073741824),resultFormat: selectedResultFormat,resolutions: selectedResolutions,languages: selectedLanguages,debridService: debridService,debridApiKey: debridApiKey,debridStreamProxyPassword: debridStreamProxyPassword,};}copyLinkButton.addEventListener("click", () => {const settings = getSettings();const settingsString = btoa(JSON.stringify(settings))const textArea = document.createElement("textarea");textArea.value = `${window.location.origin}/${settingsString}/manifest.json`;document.body.appendChild(textArea);textArea.focus();textArea.select();document.execCommand("copy");document.body.removeChild(textArea);console.log(settingsString);copyAlert.toast();});installButton.addEventListener("click", () => {const settings = getSettings();const settingsString = btoa(JSON.stringify(settings))window.location.href = `stremio://${window.location.host}/${settingsString}/manifest.json`;console.log(settingsString);installAlert.toast();});function getSettingsFromUrl() {const url = window.location.href;// Try parse settings from the URLif (url.split("/").length < 5) {console.log("no previous settings"); return null;}const settingsString = url.split("/")[3];if (typeof settingsString === "undefined") {console.log("can't fetch previous settings", settingsString)return null;}const settingsJson = atob(settingsString);return JSON.parse(settingsJson);}function populateFormFromSettings(settings) {document.getElementById("maxResults").value = settings.maxResults;document.getElementById("maxSize").value = settings.maxSize / 1073741824; // Convert back from bytes to GBdocument.getElementById("debridService").value = settings.debridService;document.getElementById("debridApiKey").value = settings.debridApiKey;document.getElementById("debridStreamProxyPassword").value = settings.debridStreamProxyPassword;document.getElementById("indexers").value = settings.indexers;if (settings.languages != "All")document.getElementById("languages").value = settings.languages;if (settings.resolutions != "All")document.getElementById("resolutions").value = settings.resolutions;if (settings.resultFormat != "All")document.getElementById("resultFormat").value = settings.resultFormat;}</script></div></div></body></html>
5 unmodified lines67891011121314151617181920215 unmodified linesasync def setup_database():try:# Ensure the database directory existsos.makedirs(os.path.dirname(settings.DATABASE_PATH), exist_ok=True)# Ensure the database file existsif not os.path.exists(settings.DATABASE_PATH):open(settings.DATABASE_PATH, "a").close()await database.connect()await database.execute("CREATE TABLE IF NOT EXISTS cache (cacheKey BLOB PRIMARY KEY, timestamp INTEGER, results TEXT)")except Exception as e:logger.error(f"Error setting up the database: {e}")5 unmodified lines67891011121314151617181920212223242526275 unmodified linesasync def setup_database():try:if settings.DATABASE_TYPE == "sqlite":os.makedirs(os.path.dirname(settings.DATABASE_PATH), exist_ok=True)if not os.path.exists(settings.DATABASE_PATH):open(settings.DATABASE_PATH, "a").close()await database.connect()await database.execute("CREATE TABLE IF NOT EXISTS cache (cacheKey TEXT PRIMARY KEY, timestamp INTEGER, results TEXT)")await database.execute("CREATE TABLE IF NOT EXISTS download_links (debrid_key TEXT, hash TEXT, file_index TEXT, link TEXT, timestamp INTEGER, PRIMARY KEY (debrid_key, hash, file_index))")await database.execute("DROP TABLE IF EXISTS active_connections")await database.execute("CREATE TABLE IF NOT EXISTS active_connections (id TEXT PRIMARY KEY, ip TEXT, content TEXT, timestamp INTEGER)")except Exception as e:logger.error(f"Error setting up the database: {e}")
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371import base64import hashlibimport jsonimport mathimport reimport aiohttpimport bencodepyfrom comet.utils.logger import loggerfrom comet.utils.models import settingstranslation_table = {"ā": "a","ă": "a","ą": "a","ć": "c","č": "c","ç": "c","ĉ": "c","ċ": "c","ď": "d","đ": "d","è": "e","é": "e","ê": "e","ë": "e","ē": "e","ĕ": "e","ę": "e","ě": "e","ĝ": "g","ğ": "g","ġ": "g","ģ": "g","ĥ": "h","î": "i","ï": "i","ì": "i","í": "i","ī": "i","ĩ": "i","ĭ": "i","ı": "i","ĵ": "j","ķ": "k","ĺ": "l","ļ": "l","ł": "l","ń": "n","ň": "n","ñ": "n","ņ": "n","ʼn": "n","ó": "o","ô": "o","õ": "o","ö": "o","ø": "o","ō": "o","ő": "o","œ": "oe","ŕ": "r","ř": "r","ŗ": "r","š": "s","ş": "s","ś": "s","ș": "s","ß": "ss","ť": "t","ţ": "t","ū": "u","ŭ": "u","ũ": "u","û": "u","ü": "u","ù": "u","ú": "u","ų": "u","ű": "u","ŵ": "w","ý": "y","ÿ": "y","ŷ": "y","ž": "z","ż": "z","ź": "z","æ": "ae","ǎ": "a","ǧ": "g","ə": "e","ƒ": "f","ǐ": "i","ǒ": "o","ǔ": "u","ǚ": "u","ǜ": "u","ǹ": "n","ǻ": "a","ǽ": "ae","ǿ": "o",}translation_table = str.maketrans(translation_table)info_hash_pattern = re.compile(r"\b([a-fA-F0-9]{40})\b")def translate(title: str):return title.translate(translation_table)def is_video(title: str):return title.endswith(tuple([".mkv",".mp4",".avi",".mov",".flv",".wmv",".webm",".mpg",".mpeg",".m4v",".3gp",".3g2",".ogv",".ogg",".drc",".gif",".gifv",".mng",".avi",".mov",".qt",".wmv",".yuv",".rm",".rmvb",".asf",".amv",".m4p",".m4v",".mpg",".mp2",".mpeg",".mpe",".mpv",".mpg",".mpeg",".m2v",".m4v",".svi",".3gp",".3g2",".mxf",".roq",".nsv",".flv",".f4v",".f4p",".f4a",".f4b",]))def bytes_to_size(bytes: int):sizes = ["Bytes", "KB", "MB", "GB", "TB"]if bytes == 0:return "0 Byte"i = int(math.floor(math.log(bytes, 1024)))return f"{round(bytes / math.pow(1024, i), 2)} {sizes[i]}"def config_check(b64config: str):try:config = json.loads(base64.b64decode(b64config).decode())if not isinstance(config["debridService"], str) or config["debridService"] not in ["realdebrid"]:return Falseif not isinstance(config["debridApiKey"], str):return Falseif not isinstance(config["indexers"], list):return Falseif not isinstance(config["maxResults"], int) or config["maxResults"] < 0:return Falseif (not isinstance(config["resolutions"], list)or len(config["resolutions"]) == 0):return Falseif not isinstance(config["languages"], list) or len(config["languages"]) == 0:return Falsereturn configexcept:return Falseasync def get_indexer_manager(session: aiohttp.ClientSession,indexer_manager_type: str,indexers: list,query: str,):try:indexers = [indexer.replace("_", " ") for indexer in indexers]timeout = aiohttp.ClientTimeout(total=settings.INDEXER_MANAGER_TIMEOUT)results = []if indexer_manager_type == "jackett":response = await session.get(f"{settings.INDEXER_MANAGER_URL}/api/v2.0/indexers/all/results?apikey={settings.INDEXER_MANAGER_API_KEY}&Query={query}&Tracker[]={'&Tracker[]='.join(indexer for indexer in indexers)}",timeout=timeout,) # &Category[]=2000&Category[]=5000response = await response.json()for result in response["Results"]:results.append(result)if indexer_manager_type == "prowlarr":get_indexers = await session.get(f"{settings.INDEXER_MANAGER_URL}/api/v1/indexer",headers={"X-Api-Key": settings.INDEXER_MANAGER_API_KEY},)get_indexers = await get_indexers.json()indexers_id = []for indexer in get_indexers:if (indexer["name"].lower() in indexersor indexer["definitionName"].lower() in indexers):indexers_id.append(indexer["id"])response = await session.get(f"{settings.INDEXER_MANAGER_URL}/api/v1/search?query={query}&indexerIds={'&indexerIds='.join(str(indexer_id) for indexer_id in indexers_id)}&type=search",headers={ # &categories=2000&categories=5000"X-Api-Key": settings.INDEXER_MANAGER_API_KEY},)response = await response.json()for result in response:results.append(result)return resultsexcept Exception as e:logger.warning(f"Exception while getting {indexer_manager_type} results for {query} with {indexers}: {e}")async def get_torrent_hash(session: aiohttp.ClientSession, indexer_manager_type: str, torrent: dict):if "InfoHash" in torrent and torrent["InfoHash"] != None:return torrent["InfoHash"]if "infoHash" in torrent:return torrent["infoHash"]url = (torrent["Link"] if indexer_manager_type == "jackett" else torrent["downloadUrl"])try:timeout = aiohttp.ClientTimeout(total=settings.GET_TORRENT_TIMEOUT)response = await session.get(url, allow_redirects=False, timeout=timeout)if response.status == 200:torrent_data = await response.read()torrent_dict = bencodepy.decode(torrent_data)info = bencodepy.encode(torrent_dict[b"info"])hash = hashlib.sha1(info).hexdigest()else:location = response.headers.get("Location", "")if not location:returnmatch = info_hash_pattern.search(location)if not match:returnhash = match.group(1).upper()return hashexcept Exception as e:logger.warning(f"Exception while getting torrent info hash for {torrent['indexer'] if 'indexer' in torrent else (torrent['Tracker'] if 'Tracker' in torrent else '')}|{url}: {e}")async def get_balanced_hashes(hashes: dict, config: dict):max_results = config["maxResults"]config_resolutions = config["resolutions"]config_languages = config["languages"]hashes_by_resolution = {}for hash in hashes:if ("All" not in config_languagesand not hashes[hash]["data"]["is_multi_audio"]and not any(language.replace("_", " ").capitalize()in hashes[hash]["data"]["language"]for language in config_languages)):continueresolution = hashes[hash]["data"]["resolution"]if len(resolution) == 0:if "All" not in config_resolutions and "Unknown" not in config_resolutions:continueif "Unknown" not in hashes_by_resolution:hashes_by_resolution["Unknown"] = [hash]continuehashes_by_resolution["Unknown"].append(hash)continueif "All" not in config_resolutions and resolution[0] not in config_resolutions:continueif resolution[0] not in hashes_by_resolution:hashes_by_resolution[resolution[0]] = [hash]continuehashes_by_resolution[resolution[0]].append(hash)if max_results == 0:return hashes_by_resolutiontotal_resolutions = len(hashes_by_resolution)hashes_per_resolution = max_results // total_resolutionsextra_hashes = max_results % total_resolutionsbalanced_hashes = {}for resolution, hashes in hashes_by_resolution.items():selected_count = hashes_per_resolutionif extra_hashes > 0:selected_count += 1extra_hashes -= 1balanced_hashes[resolution] = hashes[:selected_count]selected_total = sum(len(hashes) for hashes in balanced_hashes.values())if selected_total < max_results:missing_hashes = max_results - selected_totalfor resolution, hashes in hashes_by_resolution.items():if missing_hashes <= 0:breakcurrent_count = len(balanced_hashes[resolution])available_hashes = hashes[current_count : current_count + missing_hashes]balanced_hashes[resolution].extend(available_hashes)missing_hashes -= len(available_hashes)return balanced_hashes123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658import base64import hashlibimport jsonimport reimport aiohttpimport bencodepyimport PTTimport asynciofrom RTN import parse, title_matchfrom curl_cffi import requestsfrom fastapi import Requestfrom comet.utils.logger import loggerfrom comet.utils.models import settings, ConfigModellanguages_emojis = {"multi": "🌎", # Dubbed"en": "🇬🇧", # English"ja": "🇯🇵", # Japanese"zh": "🇨🇳", # Chinese"ru": "🇷🇺", # Russian"ar": "🇸🇦", # Arabic"pt": "🇵🇹", # Portuguese"es": "🇪🇸", # Spanish"fr": "🇫🇷", # French"de": "🇩🇪", # German"it": "🇮🇹", # Italian"ko": "🇰🇷", # Korean"hi": "🇮🇳", # Hindi"bn": "🇧🇩", # Bengali"pa": "🇵🇰", # Punjabi"mr": "🇮🇳", # Marathi"gu": "🇮🇳", # Gujarati"ta": "🇮🇳", # Tamil"te": "🇮🇳", # Telugu"kn": "🇮🇳", # Kannada"ml": "🇮🇳", # Malayalam"th": "🇹🇭", # Thai"vi": "🇻🇳", # Vietnamese"id": "🇮🇩", # Indonesian"tr": "🇹🇷", # Turkish"he": "🇮🇱", # Hebrew"fa": "🇮🇷", # Persian"uk": "🇺🇦", # Ukrainian"el": "🇬🇷", # Greek"lt": "🇱🇹", # Lithuanian"lv": "🇱🇻", # Latvian"et": "🇪🇪", # Estonian"pl": "🇵🇱", # Polish"cs": "🇨🇿", # Czech"sk": "🇸🇰", # Slovak"hu": "🇭🇺", # Hungarian"ro": "🇷🇴", # Romanian"bg": "🇧🇬", # Bulgarian"sr": "🇷🇸", # Serbian"hr": "🇭🇷", # Croatian"sl": "🇸🇮", # Slovenian"nl": "🇳🇱", # Dutch"da": "🇩🇰", # Danish"fi": "🇫🇮", # Finnish"sv": "🇸🇪", # Swedish"no": "🇳🇴", # Norwegian"ms": "🇲🇾", # Malay"la": "💃🏻", # Latino}def get_language_emoji(language: str):language_formatted = language.lower()return (languages_emojis[language_formatted]if language_formatted in languages_emojiselse language)translation_table = {"ā": "a","ă": "a","ą": "a","ć": "c","č": "c","ç": "c","ĉ": "c","ċ": "c","ď": "d","đ": "d","è": "e","é": "e","ê": "e","ë": "e","ē": "e","ĕ": "e","ę": "e","ě": "e","ĝ": "g","ğ": "g","ġ": "g","ģ": "g","ĥ": "h","î": "i","ï": "i","ì": "i","í": "i","ī": "i","ĩ": "i","ĭ": "i","ı": "i","ĵ": "j","ķ": "k","ĺ": "l","ļ": "l","ł": "l","ń": "n","ň": "n","ñ": "n","ņ": "n","ʼn": "n","ó": "o","ô": "o","õ": "o","ö": "o","ø": "o","ō": "o","ő": "o","œ": "oe","ŕ": "r","ř": "r","ŗ": "r","š": "s","ş": "s","ś": "s","ș": "s","ß": "ss","ť": "t","ţ": "t","ū": "u","ŭ": "u","ũ": "u","û": "u","ü": "u","ù": "u","ú": "u","ų": "u","ű": "u","ŵ": "w","ý": "y","ÿ": "y","ŷ": "y","ž": "z","ż": "z","ź": "z","æ": "ae","ǎ": "a","ǧ": "g","ə": "e","ƒ": "f","ǐ": "i","ǒ": "o","ǔ": "u","ǚ": "u","ǜ": "u","ǹ": "n","ǻ": "a","ǽ": "ae","ǿ": "o",}translation_table = str.maketrans(translation_table)info_hash_pattern = re.compile(r"\b([a-fA-F0-9]{40})\b")def translate(title: str):return title.translate(translation_table)def is_video(title: str):return title.endswith(tuple([".mkv",".mp4",".avi",".mov",".flv",".wmv",".webm",".mpg",".mpeg",".m4v",".3gp",".3g2",".ogv",".ogg",".drc",".gif",".gifv",".mng",".avi",".mov",".qt",".wmv",".yuv",".rm",".rmvb",".asf",".amv",".m4p",".m4v",".mpg",".mp2",".mpeg",".mpe",".mpv",".mpg",".mpeg",".m2v",".m4v",".svi",".3gp",".3g2",".mxf",".roq",".nsv",".flv",".f4v",".f4p",".f4a",".f4b",]))def bytes_to_size(bytes: int):sizes = ["Bytes", "KB", "MB", "GB", "TB"]if bytes == 0:return "0 Byte"i = 0while bytes >= 1024 and i < len(sizes) - 1:bytes /= 1024i += 1return f"{round(bytes, 2)} {sizes[i]}"def config_check(b64config: str):try:config = json.loads(base64.b64decode(b64config).decode())validated_config = ConfigModel(**config)return validated_config.model_dump()except:return Falsedef get_debrid_extension(debridService: str):debrid_extension = Noneif debridService == "realdebrid":debrid_extension = "RD"elif debridService == "alldebrid":debrid_extension = "AD"elif debridService == "premiumize":debrid_extension = "PM"elif debridService == "torbox":debrid_extension = "TB"elif debridService == "debridlink":debrid_extension = "DL"return debrid_extensionasync def get_indexer_manager(session: aiohttp.ClientSession,indexer_manager_type: str,indexers: list,query: str,):results = []try:indexers = [indexer.replace("_", " ") for indexer in indexers]if indexer_manager_type == "jackett":async def fetch_jackett_results(session: aiohttp.ClientSession, indexer: str, query: str):try:async with session.get(f"{settings.INDEXER_MANAGER_URL}/api/v2.0/indexers/all/results?apikey={settings.INDEXER_MANAGER_API_KEY}&Query={query}&Tracker[]={indexer}",timeout=aiohttp.ClientTimeout(total=settings.INDEXER_MANAGER_TIMEOUT),) as response:response_json = await response.json()return response_json.get("Results", [])except Exception as e:logger.warning(f"Exception while fetching Jackett results for indexer {indexer}: {e}")return []tasks = [fetch_jackett_results(session, indexer, query) for indexer in indexers]all_results = await asyncio.gather(*tasks)for result_set in all_results:results.extend(result_set)elif indexer_manager_type == "prowlarr":get_indexers = await session.get(f"{settings.INDEXER_MANAGER_URL}/api/v1/indexer",headers={"X-Api-Key": settings.INDEXER_MANAGER_API_KEY},)get_indexers = await get_indexers.json()indexers_id = []for indexer in get_indexers:if (indexer["name"].lower() in indexersor indexer["definitionName"].lower() in indexers):indexers_id.append(indexer["id"])response = await session.get(f"{settings.INDEXER_MANAGER_URL}/api/v1/search?query={query}&indexerIds={'&indexerIds='.join(str(indexer_id) for indexer_id in indexers_id)}&type=search",headers={"X-Api-Key": settings.INDEXER_MANAGER_API_KEY},)response = await response.json()for result in response:result["InfoHash"] = (result["infoHash"] if "infoHash" in result else None)result["Title"] = result["title"]result["Size"] = result["size"]result["Link"] = (result["downloadUrl"] if "downloadUrl" in result else None)result["Tracker"] = result["indexer"]results.append(result)except Exception as e:logger.warning(f"Exception while getting {indexer_manager_type} results for {query} with {indexers}: {e}")passreturn resultsasync def get_zilean(session: aiohttp.ClientSession, name: str, log_name: str, season: int, episode: int):results = []try:show = f"&season={season}&episode={episode}"get_dmm = await session.get(f"{settings.ZILEAN_URL}/dmm/filtered?query={name}{show if season else ''}")get_dmm = await get_dmm.json()if isinstance(get_dmm, list):take_first = get_dmm[: settings.ZILEAN_TAKE_FIRST]for result in take_first:object = {"Title": result["raw_title"],"InfoHash": result["info_hash"],"Size": result["size"],"Tracker": "DMM",}results.append(object)logger.info(f"{len(results)} torrents found for {log_name} with Zilean")except Exception as e:logger.warning(f"Exception while getting torrents for {log_name} with Zilean: {e}")passreturn resultsasync def get_torrentio(log_name: str, type: str, full_id: str):results = []try:try:get_torrentio = requests.get(f"https://torrentio.strem.fun/stream/{type}/{full_id}.json").json()except:get_torrentio = requests.get(f"https://torrentio.strem.fun/stream/{type}/{full_id}.json",proxies={"http": settings.DEBRID_PROXY_URL,"https": settings.DEBRID_PROXY_URL,},).json()for torrent in get_torrentio["streams"]:title = torrent["title"]title_full = title.split("\n👤")[0]tracker = title.split("⚙️ ")[1].split("\n")[0]results.append({"Title": title_full,"InfoHash": torrent["infoHash"],"Size": None,"Tracker": f"Torrentio|{tracker}",})logger.info(f"{len(results)} torrents found for {log_name} with Torrentio")except Exception as e:logger.warning(f"Exception while getting torrents for {log_name} with Torrentio, your IP is most likely blacklisted (you should try proxying Comet): {e}")passreturn resultsasync def get_mediafusion(log_name: str, type: str, full_id: str):results = []try:try:get_mediafusion = requests.get(f"{settings.MEDIAFUSION_URL}/stream/{type}/{full_id}.json").json()except:get_mediafusion = requests.get(f"{settings.MEDIAFUSION_URL}/stream/{type}/{full_id}.json",proxies={"http": settings.DEBRID_PROXY_URL,"https": settings.DEBRID_PROXY_URL,},).json()for torrent in get_mediafusion["streams"]:title_full = torrent["description"]title = title_full.split("\n")[0] if "\n" in title_full else title_fulltracker = title_full.split("🔗 ")[1] if "🔗" in title_full else "Unknown"results.append({"Title": title,"InfoHash": torrent["infoHash"],"Size": torrent["behaviorHints"]["videoSize"], # not the pack size but still useful for prowlarr userss"Tracker": f"MediaFusion|{tracker}",})logger.info(f"{len(results)} torrents found for {log_name} with MediaFusion")except Exception as e:logger.warning(f"Exception while getting torrents for {log_name} with MediaFusion, your IP is most likely blacklisted (you should try proxying Comet): {e}")passreturn resultsasync def filter(torrents: list, name: str, year: int):results = []for torrent in torrents:index = torrent[0]title = torrent[1]if "\n" in title: # Torrentio title parsingtitle = title.split("\n")[1]parsed = parse(title)if parsed.parsed_title and not title_match(name, parsed.parsed_title):results.append((index, False))continueif year and parsed.year and year != parsed.year:results.append((index, False))continueresults.append((index, True))return resultsasync def get_torrent_hash(session: aiohttp.ClientSession, torrent: tuple):index = torrent[0]torrent = torrent[1]if "InfoHash" in torrent and torrent["InfoHash"] is not None:return (index, torrent["InfoHash"].lower())url = torrent["Link"]try:timeout = aiohttp.ClientTimeout(total=settings.GET_TORRENT_TIMEOUT)response = await session.get(url, allow_redirects=False, timeout=timeout)if response.status == 200:torrent_data = await response.read()torrent_dict = bencodepy.decode(torrent_data)info = bencodepy.encode(torrent_dict[b"info"])hash = hashlib.sha1(info).hexdigest()else:location = response.headers.get("Location", "")if not location:return (index, None)match = info_hash_pattern.search(location)if not match:return (index, None)hash = match.group(1).upper()return (index, hash.lower())except Exception as e:logger.warning(f"Exception while getting torrent info hash for {torrent['indexer'] if 'indexer' in torrent else (torrent['Tracker'] if 'Tracker' in torrent else '')}|{url}: {e}")return (index, None)def get_balanced_hashes(hashes: dict, config: dict):max_results = config["maxResults"]max_size = config["maxSize"]config_resolutions = [resolution.lower() for resolution in config["resolutions"]]include_all_resolutions = "all" in config_resolutionslanguages = [language.lower() for language in config["languages"]]include_all_languages = "all" in languagesif not include_all_languages:config_languages = [codefor code, name in PTT.parse.LANGUAGES_TRANSLATION_TABLE.items()if name.lower() in languages]hashes_by_resolution = {}for hash, hash_data in hashes.items():hash_info = hash_data["data"]if max_size != 0 and hash_info["size"] > max_size:continueif (not include_all_languagesand not any(lang in hash_info["languages"] for lang in config_languages)and ("multi" not in languages if hash_info["dubbed"] else True)):continueresolution = hash_info["resolution"]if not include_all_resolutions and resolution not in config_resolutions:continueif resolution not in hashes_by_resolution:hashes_by_resolution[resolution] = []hashes_by_resolution[resolution].append(hash)total_resolutions = len(hashes_by_resolution)if max_results == 0 or total_resolutions == 0:return hashes_by_resolutionhashes_per_resolution = max_results // total_resolutionsextra_hashes = max_results % total_resolutionsbalanced_hashes = {}for resolution, hash_list in hashes_by_resolution.items():selected_count = hashes_per_resolution + (1 if extra_hashes > 0 else 0)balanced_hashes[resolution] = hash_list[:selected_count]if extra_hashes > 0:extra_hashes -= 1selected_total = sum(len(hashes) for hashes in balanced_hashes.values())if selected_total < max_results:missing_hashes = max_results - selected_totalfor resolution, hash_list in hashes_by_resolution.items():if missing_hashes <= 0:breakcurrent_count = len(balanced_hashes[resolution])available_hashes = hash_list[current_count : current_count + missing_hashes]balanced_hashes[resolution].extend(available_hashes)missing_hashes -= len(available_hashes)return balanced_hashesdef format_metadata(data: dict):extras = []if data["quality"]:extras.append(data["quality"])if data["hdr"]:extras.extend(data["hdr"])if data["codec"]:extras.append(data["codec"])if data["audio"]:extras.extend(data["audio"])if data["channels"]:extras.extend(data["channels"])if data["bit_depth"]:extras.append(data["bit_depth"])if data["network"]:extras.append(data["network"])if data["group"]:extras.append(data["group"])return "|".join(extras)def format_title(data: dict, config: dict):title = ""if "All" in config["resultFormat"] or "Title" in config["resultFormat"]:title += f"{data['title']}\n"if "All" in config["resultFormat"] or "Metadata" in config["resultFormat"]:metadata = format_metadata(data)if metadata != "":title += f"💿 {metadata}\n"if "All" in config["resultFormat"] or "Size" in config["resultFormat"]:title += f"💾 {bytes_to_size(data['size'])} "if "All" in config["resultFormat"] or "Tracker" in config["resultFormat"]:title += f"🔎 {data['tracker'] if 'tracker' in data else '?'}"if "All" in config["resultFormat"] or "Languages" in config["resultFormat"]:languages = data["languages"]if data["dubbed"]:languages.insert(0, "multi")formatted_languages = ("/".join(get_language_emoji(language) for language in languages)if languageselse None)languages_str = "\n" + formatted_languages if formatted_languages else ""title += f"{languages_str}"if title == "":# Without this, Streamio shows SD as the result, which is confusingtitle = "Empty result format configuration"return titledef get_client_ip(request: Request):return (request.headers["cf-connecting-ip"]if "cf-connecting-ip" in request.headerselse request.client.host)
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657import osfrom typing import List, Optionalfrom databases import Databasefrom pydantic_settings import BaseSettings, SettingsConfigDictfrom RTN import RTN, BaseRankingModel, SettingsModelclass AppSettings(BaseSettings):model_config = SettingsConfigDict(env_file=".env", env_file_encoding="utf-8")ADDON_ID: str = "stremio.comet.fast"ADDON_NAME: str = "Comet"FASTAPI_HOST: str = "0.0.0.0"FASTAPI_PORT: int = 8000FASTAPI_WORKERS: int = 2 * (os.cpu_count() or 1)DATABASE_PATH: str = "data/comet.db"CACHE_TTL: int = 86400DEBRID_PROXY_URL: Optional[str] = NoneINDEXER_MANAGER_TYPE: str = "jackett"INDEXER_MANAGER_URL: str = "http://127.0.0.1:9117"INDEXER_MANAGER_API_KEY: str = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"INDEXER_MANAGER_TIMEOUT: int = 30INDEXER_MANAGER_INDEXERS: List[str] = ["EXAMPLE1_CHANGETHIS", "EXAMPLE2_CHANGETHIS"]GET_TORRENT_TIMEOUT: int = 5ZILEAN_URL: Optional[str] = NoneCUSTOM_HEADER_HTML: Optional[str] = Noneclass BestOverallRanking(BaseRankingModel):uhd: int = 100fhd: int = 90hd: int = 80sd: int = 70dolby_video: int = 100hdr: int = 80hdr10: int = 90dts_x: int = 100dts_hd: int = 80dts_hd_ma: int = 90atmos: int = 90truehd: int = 60ddplus: int = 40aac: int = 30ac3: int = 20remux: int = 150bluray: int = 120webdl: int = 90rtn_settings: SettingsModel = SettingsModel()rtn_ranking: BestOverallRanking = BestOverallRanking()# For use anywherertn: RTN = RTN(settings=rtn_settings, ranking_model=rtn_ranking)settings: AppSettings = AppSettings()database = Database(f"sqlite:///{settings.DATABASE_PATH}")123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125import osimport randomimport stringfrom typing import List, Optionalfrom databases import Databasefrom pydantic import BaseModel, field_validatorfrom pydantic_settings import BaseSettings, SettingsConfigDictfrom RTN import RTN, BestRanking, SettingsModelclass AppSettings(BaseSettings):model_config = SettingsConfigDict(env_file=".env", env_file_encoding="utf-8")ADDON_ID: Optional[str] = "stremio.comet.fast"ADDON_NAME: Optional[str] = "Comet"FASTAPI_HOST: Optional[str] = "0.0.0.0"FASTAPI_PORT: Optional[int] = 8000FASTAPI_WORKERS: Optional[int] = 2 * (os.cpu_count() or 1)DASHBOARD_ADMIN_PASSWORD: Optional[str] = NoneDATABASE_TYPE: Optional[str] = "sqlite"DATABASE_URL: Optional[str] = "username:password@hostname:port"DATABASE_PATH: Optional[str] = "data/comet.db"CACHE_TTL: Optional[int] = 86400DEBRID_PROXY_URL: Optional[str] = NoneINDEXER_MANAGER_TYPE: Optional[str] = NoneINDEXER_MANAGER_URL: Optional[str] = "http://127.0.0.1:9117"INDEXER_MANAGER_API_KEY: Optional[str] = NoneINDEXER_MANAGER_TIMEOUT: Optional[int] = 30INDEXER_MANAGER_INDEXERS: List[str] = ["EXAMPLE1_CHANGETHIS", "EXAMPLE2_CHANGETHIS"]GET_TORRENT_TIMEOUT: Optional[int] = 5ZILEAN_URL: Optional[str] = NoneZILEAN_TAKE_FIRST: Optional[int] = 500SCRAPE_TORRENTIO: Optional[bool] = FalseSCRAPE_MEDIAFUSION: Optional[bool] = FalseMEDIAFUSION_URL: Optional[str] = "https://mediafusion.elfhosted.com"CUSTOM_HEADER_HTML: Optional[str] = NonePROXY_DEBRID_STREAM: Optional[bool] = FalsePROXY_DEBRID_STREAM_PASSWORD: Optional[str] = NonePROXY_DEBRID_STREAM_MAX_CONNECTIONS: Optional[int] = 100PROXY_DEBRID_STREAM_DEBRID_DEFAULT_SERVICE: Optional[str] = "realdebrid"PROXY_DEBRID_STREAM_DEBRID_DEFAULT_APIKEY: Optional[str] = NoneTITLE_MATCH_CHECK: Optional[bool] = True@field_validator("DASHBOARD_ADMIN_PASSWORD")def set_dashboard_admin_password(cls, v, values):if v is None:return "".join(random.choices(string.ascii_letters + string.digits, k=16))return v@field_validator("INDEXER_MANAGER_TYPE")def set_indexer_manager_type(cls, v, values):if v == "None":return Nonereturn v@field_validator("PROXY_DEBRID_STREAM_PASSWORD")def set_debrid_stream_proxy_password(cls, v, values):if v is None:return "".join(random.choices(string.ascii_letters + string.digits, k=16))return vsettings = AppSettings()class ConfigModel(BaseModel):indexers: List[str]languages: Optional[List[str]] = ["All"]resolutions: Optional[List[str]] = ["All"]resultFormat: Optional[List[str]] = ["All"]maxResults: Optional[int] = 0maxSize: Optional[float] = 0debridService: strdebridApiKey: strdebridStreamProxyPassword: Optional[str] = ""@field_validator("indexers")def check_indexers(cls, v, values):settings.INDEXER_MANAGER_INDEXERS = [indexer.replace(" ", "_").lower()for indexer in settings.INDEXER_MANAGER_INDEXERS] # to equal webuivalid_indexers = [indexer for indexer in v if indexer in settings.INDEXER_MANAGER_INDEXERS]# if not valid_indexers: # For only Zilean mode# raise ValueError(# f"At least one indexer must be from {settings.INDEXER_MANAGER_INDEXERS}"# )return valid_indexers@field_validator("maxResults")def check_max_results(cls, v):if v < 0:v = 0return v@field_validator("maxSize")def check_max_size(cls, v):if v < 0:v = 0return v@field_validator("debridService")def check_debrid_service(cls, v):if v not in ["realdebrid", "alldebrid", "premiumize", "torbox", "debridlink"]:raise ValueError("Invalid debridService")return vrtn_settings = SettingsModel()rtn_ranking = BestRanking()# For use anywherertn = RTN(settings=rtn_settings, ranking_model=rtn_ranking)database_url = (settings.DATABASE_PATHif settings.DATABASE_TYPE == "sqlite"else settings.DATABASE_URL)database = Database(f"{'sqlite' if settings.DATABASE_TYPE == 'sqlite' else 'postgresql+asyncpg'}://{'/' if settings.DATABASE_TYPE == 'sqlite' else ''}{database_url}")
1234567891011121314volumes: comet_data:
services: comet: container_name: comet image: g0ldyy/comet restart: unless-stopped ports: - "8000:8000" env_file: - .env volumes: - comet_data:/data8 unmodified lines91011121314151617181920212223248 unmodified lines[tool.poetry.dependencies]python = "^3.11"rank-torrent-name = "*"uvicorn = "*"fastapi = "*"aiohttp = "*"bencodepy = "*"asyncio = "*"loguru = "*"databases = "*"aiosqlite = "*"pydantic-settings = "*"[tool.poetry.group.dev.dependencies]isort = "*"8 unmodified lines9101112131415161718192021222324252627282930318 unmodified lines[tool.poetry.dependencies]python = "^3.11"uvicorn = "*"fastapi = "*"aiohttp = "*"asyncio = "*"loguru = "*"databases = "*"pydantic-settings = "*"bencode-py = "*"httpx = "*"curl-cffi = "*"orjson = "*"asyncpg = "*"aiosqlite = "*"jinja2 = "*"rank-torrent-name = "*"parsett = "*"[tool.poetry.group.dev.dependencies]isort = "*"
.env+25-12
.env-sampleAdded+29
CHANGELOG.md+643
Dockerfile+28-30
comet/api/core.py+29-24
comet/api/stream.py+459-182
comet/assets/invalidconfig.mp4Added
comet/assets/proxylimit.mp4Added
comet/assets/uncached.mp4Added
comet/debrid/alldebrid.pyAdded+172
comet/debrid/debridlink.pyAdded+126
comet/debrid/manager.py+17-3
comet/debrid/premiumize.pyAdded+177
comet/debrid/realdebrid.py+134-32
comet/debrid/torbox.pyAdded+161
comet/main.py+34-7
comet/templates/index.html+794-577
comet/utils/db.py+12-6
comet/utils/general.py+658-371
comet/utils/models.py+107-39
docker-compose.yamlAdded+14
pyproject.toml+10-3