32 Commits

Author SHA1 Message Date
mhdzumair cde8d5a462 fmt & update packages 2025-04-30 05:46:02 +05:30
Viren070 1c4bfa2d1f fix: add secret_str when using encoded_user_data (#501)
* fix: add secret_str handling in middleware when using encoded_user_data

* fix: fallback only

* fix: get directly

* fix: use request.scope

* fix: await

* style: format
2025-04-30 04:52:26 +05:30
mhdzumair 620ad95861 Fix parsing edge cases and Fix mediaflow private IP validation logic
Addressed cases where parsing would fail due to empty elements or missing data in BT4G scraper and streaming provider parsers. Enhanced IP validation in network utilities to handle IPv6 formats with ports and brackets accurately. These changes improve robustness and prevent errors in edge scenarios.
2025-02-01 22:54:55 +05:30
mhdzumair 82144e27ef Refactor private IP address checks with ipaddress module
Replaced regex-based private IP detection with a utility function `is_private_ip` using the `ipaddress` module.
2025-01-19 08:01:55 +05:30
mhdzumair 2826070507 Fix MediaFlow proxy ip fallback and remove url validation 2025-01-05 17:56:21 +05:30
mhdzumair 98085b7c06 Add support for request proxy with httpx & aiohttp libs
Replaced custom proxy implementation and `curl-cffi` with unified `httpx` and `aiohttp` proxy support using `requests_proxy_url` config from settings. Simplified and standardized HTTP client instantiations across various modules for improved maintainability and consistency.
2024-12-13 15:55:10 +05:30
mhdzumair 1483336adc Refactor Redis client imports and configuration
Moved Redis client setup to a new module `redis_database` and updated all references across the codebase. Also added a new configuration setting for redis_max_connections for better resource management.
2024-11-28 16:08:34 +05:30
Mohamed Zumair ecf69fe969 Enhanced scraping capabilities with improved indexer search with health checks and metrics tracking (#367)
* Add support for comprehensive scraper metrics tracking

Renamed scrape_and_parse to _scrape_and_parse, adding comprehensive error handling and logging metrics for various scenarios like timeouts, HTTP errors, and validation issues. Incorporated a metrics class in base_scraper.py to summarize statistics related to scraping performance, which is now used across different scrapers including prowlarr, torrentio, and zilean.

* Enhance Prowlarr individual indexer searching logic with indexer healthcheck management & comprehensive metrics summary

Added detailed health checks for indexers and included their statuses in logging. Enhanced background search to use circuit breakers and handle indexers in chunks, improving reliability and fault tolerance.

* Handle custom id items with imdb id based on title and year matching for moving to imdb title

* handle exception onf fetching prowlarr indexer torrent page fetching

* Refactor Circuit Breaker and add state management methods

Reorganized Circuit Breaker class for better clarity and maintainability. Added methods to manage states (`is_closed`, `reset`, `record_failure`, `record_success`) and refactored `call` method to utilize these state checks. Enhanced logging and status reporting with `get_status` method.

* Simplify series metadata & episode data retrieval logic

Streamlined the `get_series_meta` function by removing complex filtering conditions and reducing the aggregation pipeline.

* Refactor CircuitBreaker for web scraping and enhanced recovery
2024-11-21 13:02:30 +05:30
mhdzumair 88521d9dd7 Fix mediaflow name typo 2024-10-16 14:48:19 +05:30
mhdzumair 2b40970032 Fix MediaFlow proxy url var typo 2024-10-16 03:52:19 +05:30
Mohamed Zumair 52d8956034 Add ScrapeOps monitoring, Add zilean filtered endpoint, Fix Prowlarr scraping with download link & Fix PikPak login error etc (#319)
* Refactor ZileanScraper to use parallel requests for searching and filtering streams with new endpoints

* Fix DLHD scraping & enable DLHD without MediaFlow

* Switch to httpx for async HTTP requests

* Implement caching for PikPak token to reduce login error

* Refactor torrent cleanup logic

* Add inactivity monitor extension to close idle spiders

Introduced `InactivityMonitor` to automatically close spiders that remain inactive for a specified time. This extension checks activity at regular intervals and uses configurable settings for check intervals and inactivity timeouts. If no items are scraped within the timeout period, the spider is closed to free resources.

* Handle TypeError in dynamic sorting of streams

* Refactor torrent info scraper to support pre-processing.

Introduced a pre-processing function mapping to handle specific indexer requirements before parsing the HTML. Added a custom pre-processing function for "TheRARBG" to handle URL adjustments, improving modularity and readability in the `get_torrent_info` function.

* Refine error logging and fix hash key in spider

* Fix Prowlarr not stop on max process limit

* #315: Integrate ScrapeOps logging into all scrapers & spiders

Added ScrapeOps logging to Zilean, Torrentio, Prowlarr, and Prowlarr Feed scrapers to enhance request tracking and error handling. Configured ScrapeOps API key in settings and updated Pipfile/Pipfile.lock with scrapeops-python-requests and scrapeops-scrapy dependencies.

* Refactor scraper cache status handler

* verify torrent before parsing on prowlarr & prioritize magnet on badass_torrents

* Add support for provide locally hosted mediaflow proxy public address and reduce the time leg on private ip address checking

* handle RD exception cases

* do not setup scrapeops when api key is none

* Enhanced dynamic sorting of torrent streams

Revised the dynamic_sort_key function to handle different key types more efficiently with match-case. Simplified error handling and improved logging to capture sorting data in the case of exceptions.

* add missing last update date for metadata

* update domain for nowmesports
2024-10-14 05:58:23 +05:30
Mohamed Zumair db7fab8b40 Prepare Release, Update docs with new features & Bug fixes (#303)
* Refactor Kodi addon setup to input code after expire

* Use `parse.urljoin` for URL construction

* Add error handling for cache setup and request response

* Fix WebDAV auth configuration and enhance README setup guide

* Update color values for Kodi Setup visibility

* Refactor kodi request cache

* Update README and home page with new features
2024-09-28 19:45:16 +05:30
Mohamed Zumair fb6237ef16 Refactor Zilean scraper for v2 changes & Add support RD private token & Enhance Error Handling
* Fix error handling and add specific exceptions

* Add support for private tokens in RealDebrid client

* UI: Enhance Kodi setup modal with a guide link

* Refactor Zilean scraper for v2 changes & improved error handling

* Handle Binascii error in RealDebrid client token decoding
2024-09-28 08:14:23 +05:30
Mohamed Zumair 709dc25d94 Enhance TV streaming functionality with MPD DRM support, and updated spiders & Bugfixes (#298)
* Refactor stream parsing and handling for DRM and MediaFlow

* Add encryption support for mediaflow url and refactor URL validation

* Enhance LiveTV spider to support MPD and handle new player API logic

* Update TV stream validation and add DRM fields in UI

* Add mediaflow_proxy_required.mp4 exception video

* Add FlareSolverr integration to scrapy spiders

* [WIP] TamilBulb spider to scraper

* Update StreamedSpider to new API and adjust schedulers
2024-09-27 08:13:10 +05:30
Mohamed Zumair c8f660b7ee Add Support for download streams via web browser & support disabling the metadata for imdb title (#287)
* Add Support for download streams via web browser & support disabling the metadata for imdb title

* Add env config to enable or disable download via browser feature
2024-09-18 06:54:37 +05:30
Mohamed Zumair cf8ed59012 Added Prowlarr feed scraping & Improve Advanced scraping capability for prowlarr, zilean, torrentio & more bugfixes & improvements (#286)
* Update Python version

* Refactor Redis client

* WIP: Refactor scrapers

* Added Prowlarr feed scraping & Improve Advanced scraping capability for prowlarr, zilean, torrentio & more bugfixes & improvements

* Improve batch_process_with_circuit_breaker implementation to yield an individual task as soon as completed
2024-09-16 08:26:57 +05:30
Mohamed Zumair d169b28aec Add support for RPDB posters & Support fallback posters via MediaFusion posters (#284) 2024-09-12 12:17:33 +05:30
Mohamed Zumair 649de9e503 Update Python version & refactror Redis client usage and streaming provider route endpoints (#277)
* Update Python version

* Refactor Redis client

* Refactor streaming routes endpoint functions
2024-09-05 06:46:07 +05:30
Mohamed Zumair e502d0f10e Add support for MediaFlow Proxy for Debrid stream & Live stream (#271)
* Add support for MediaFlow Proxy for Debrid stream & Live stream

* Add emoji for mediaflow proxy stream and add error logging
2024-08-29 10:02:01 +05:30
mhdzumair 6cccdb44b7 remove header logging 2024-07-21 09:25:23 +05:30
Mohamed Zumair 130b4c06a5 Add support for parental guides nudity filter and certification filter in user config (#244)
* Add support for parental guides nudity filter and certification filter in user config

* refactor validator according to review
2024-07-21 09:18:19 +05:30
mhdzumair cc7a08e64a Show general exc traceback on batch processing 2024-07-08 00:48:33 +05:30
mhdzumair 9e7ecc809f Add more keywords for category 8000, prowlarr scraped torrent language fixed & other bugfixes 2024-06-09 23:15:06 +05:30
mhdzumair 4b926b0535 Add support namespace in Live TV streams to store specific to elfhosted tenants namespace 2024-06-03 13:17:07 +05:30
mhdzumair 635a032c66 Add maximum number of retries to batch processing with circuit breaker 2024-05-25 22:42:43 +05:30
mhdzumair 45bf4e01d4 Add support for forward user's IP to Alldebrid & refactoring streaming providers 2024-05-12 19:02:40 +05:30
mhdzumair 02814c5fda create imdb scraping data functions & schedule job for periodic scraping 2024-05-05 23:59:30 +05:30
mhdzumair 59d04f1475 add user IP to RealDebrid POST requests 2024-04-21 20:25:33 +05:30
mhdzumair f04d537ee2 Add tamilultra scrapy & add support for trigger scrapers & consolidate apscheduler, background worker & bugfixes 2024-03-17 17:41:03 +05:30
mhdzumair df7539b2b5 Refactor exception handling in prowlarr_data_parser and batch_process_with_circuit_breaker 2024-02-07 01:40:24 +05:30
mhdzumair 1351d5c96d Refactor API data fetching in prowlarr.py and handle exceptions in network.py 2024-02-04 11:18:18 +05:30
mhdzumair 5fadfac0a9 Add dramatiq library and enhance prowlarr search functionality 2024-02-03 19:57:35 +05:30