Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass stremio video id to stremthru magnet cache check #407

Merged
merged 1 commit into from
Jan 2, 2025

Conversation

MunifTanjim
Copy link
Contributor

@MunifTanjim MunifTanjim commented Dec 31, 2024

StremThru needs the Stremio Video ID to reliably respond with magnet cache info for tv series.

Summary by CodeRabbit

  • New Features

    • Enhanced torrent availability checking with optional Stremio video ID support.
    • Improved stream filtering and sorting functionality with Stremio video ID integration.
  • Improvements

    • Updated cache status update mechanism to utilize Stremio video ID.
    • Added more flexible parameter handling for stream processing.

These changes provide more granular control and enhanced metadata handling for stream and torrent-related operations, potentially improving the overall streaming experience.

Copy link
Contributor

coderabbitai bot commented Dec 31, 2024

Walkthrough

The pull request introduces modifications to multiple files to enhance the handling of Stremio video IDs across the streaming providers system. The changes primarily focus on adding an optional stremio_video_id parameter to key functions in the StremThru client, utility functions, and stream parsing utilities. This modification allows for more flexible and detailed tracking of video content during stream availability and caching processes.

Changes

File Change Summary
streaming_providers/stremthru/client.py - Updated get_torrent_instant_availability method to accept optional stremio_video_id
- Modified _make_request method return type annotation
streaming_providers/stremthru/utils.py - Added stremio_video_id parameter to update_st_cache_status function
utils/parser.py - Added stremio_video_id parameter to filter_and_sort_streams function
- Updated stream data parsing logic to construct Stremio video ID

Sequence Diagram

sequenceDiagram
    participant Parser as Stream Parser
    participant CacheUpdate as Cache Update Function
    participant StremThru as StremThru Client
    
    Parser->>CacheUpdate: Call with stremio_video_id
    CacheUpdate->>StremThru: Request torrent availability
    StremThru-->>CacheUpdate: Return availability data
    CacheUpdate-->>Parser: Update cache status
Loading

Possibly related PRs

  • Add StremThru as streaming provider #345: The changes in this PR add the StremThru streaming provider, which is directly related to the modifications made in the main PR regarding the get_torrent_instant_availability method in the StremThru class.
  • Clarification for StremThru config #370: This PR provides clarifications for the StremThru configuration, which is relevant to the enhancements made in the main PR that involve the stremio_video_id parameter.
  • Read redis debrid cache for StremThru #383: This PR modifies the handling of StremThru in the Redis debrid cache, which relates to the overall functionality and integration of the StremThru service as described in the main PR.
  • StremThru Improvements #385: This PR introduces improvements to the StremThru service, which aligns with the enhancements made in the main PR regarding the get_torrent_instant_availability method and its parameters.

Suggested labels

hacktoberfest-accepted

Poem

🐰 A Rabbit's Ode to Streaming Delight 🎬

With Stremio ID in paw, we dance,
Torrents now have a smarter chance,
Caching magic, smooth and bright,
Streams flow on with pure delight!

Hop, hop, hooray for code so clean! 🚀


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e92fc05 and 20ba1ca.

📒 Files selected for processing (3)
  • streaming_providers/stremthru/client.py (1 hunks)
  • streaming_providers/stremthru/utils.py (1 hunks)
  • utils/parser.py (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • streaming_providers/stremthru/utils.py
  • utils/parser.py
  • streaming_providers/stremthru/client.py

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@mhdzumair
Copy link
Owner

Why it is required the video ID to find the cache detail? Doesn't it redirect the cache endpoint callback to the relevant service?

Since mediafusion itself having the filename validations, I don't think it's required to add imdb id detail

@MunifTanjim
Copy link
Contributor Author

Why it is required the video ID to find the cache detail? Doesn't it redirect the cache endpoint callback to the relevant service?

Since mediafusion itself having the filename validations, I don't think it's required to add imdb id detail

For services that provide that info (e.g. oc, pm, tb) the api call is just forwarded to them. But for others (rd/ad/dl) it uses crowdsourced data (collected when user interacts with their debrid account using st, similar to what mf does) and also scraped data from various sources (which sometimes requires the video id). It still works without the video id, but with video id it's able to provide more data. You can try it out and see the difference in result with and without passing the video id.

@MunifTanjim MunifTanjim force-pushed the feat-stremthru-series branch from e92fc05 to 20ba1ca Compare January 2, 2025 03:12
@mhdzumair mhdzumair merged commit d67a67a into mhdzumair:main Jan 2, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants