Refactor stream routes to JSON API responses - #23
Open
SasukeXDev wants to merge 8 commits into
Open
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Description
home,playlist,channel,search,dbsearch, andwatchroutes by usingweb.json_response(...)and returning structured payloads rather than rendered snippets._is_admin,_auth_payload,_serialize_document, and_with_watch_urlsto centralize auth payloads and document serialization (including converting Mongo_idtoid) and to attachwatch_url/download_urlto items.bot/helper/chats.pyandbot/helper/index.pyto return structured dictionaries/lists (withpublic_id,thumbnail_url,watch_url, etc.) instead of HTML strings so routes can forward JSON data directly.media_streamer()and the routeGET /{chat_id}/{encoded_name}; updatedwatchroute to return file metadata and stream/download URLs (including video metadata when available).bot/server/render_template.pyand thebot/server/template/HTML files since API routes no longer callrender_page().Testing
python -m compileall botto verify modules compile after refactor, which completed successfully.render_pageand server templates were removed, and those checks passed (no remaining backend HTML responses in the modified routes).Codex Task