Conversation
📝 WalkthroughWalkthroughThis pull request adds a new Tollywood (Telugu-language movies) provider to the registry. The implementation includes provider factory function, wrapper class, registry entry, index exports, provider map configuration, and test files covering search, featured content, and media information fetching. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Tip Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 8
🤖 Fix all issues with AI agents
In `@src/extension-registry.json`:
- Around line 158-179: The tollywood extension entry (id "tollywood") marks a
frequently changing MovieRulz domain as "stable"; change "status" to "beta" or
"alpha" to reflect fragility and add a small metadata flag like
"domainStability": "volatile" or "note": "baseUrl may change frequently" so
consumers know to expect updates, and ensure any future domain rotations update
"baseUrl" and "lastUpdated" when you replace the endpoint.
In `@src/providers/movies/tollywood/create-tollywood.ts`:
- Around line 396-430: The current server-branch handlers in create-tollywood.ts
return serverData.url directly (notably the vcdnlare, uperbox, dropress branches
inside the code that checks serverData.url) and even hard-code isM3U8: true for
vcdnlare; implement proper source extraction for each of these hosters (parse
their actual embed/player URLs, fetch and resolve m3u8 or direct stream links,
and set isM3U8 correctly) inside the same conditional blocks that now return raw
URLs, or if you cannot support them, update the provider metadata (the registry
flag haveMultiServers) and add clear fallback behavior/logging so consumers know
only StreamTape is supported rather than returning non-playable URLs.
- Around line 339-344: The fallback that always pushes a StreamTape entry inside
fetchEpisodeServers makes the servers array never empty and thus renders the
servers.length === 0 guard in fetchEpisodeSources unreachable; remove the
unconditional fallback from fetchEpisodeServers (the block that pushes { name:
'StreamTape', url }) so fetchEpisodeServers can return an empty array when
nothing was found, and if you still want a fallback keep that logic inside
fetchEpisodeSources after calling fetchEpisodeServers (i.e., check if servers is
empty there and then insert the StreamTape fallback) so callers can distinguish
"no real servers found" from "fallback used."
- Around line 59-88: Extract the repeated movie-parsing block into a single
helper function, e.g. parseMovieListings($: CheerioAPI, baseUrl: string):
IMovieResult[], and replace the duplicated code in search, fetchTeluguFeatured,
fetchTeluguByYear, and fetchLatestMovies with calls to this helper; the helper
should iterate $('div[id^="post-"]'), find h2/a/img, extract title, url and
image, normalize image to absolute only when it startsWith('http'), derive
movieId by stripping baseUrl and leading/trailing slashes, parse a four-digit
year with /\((\d{4})\)/, apply a consistent cleaning regex that includes
HDRip|DVDScr|BRRip|DVDRip|WebRip|CAM|HDTS|Telugu|Hindi|Dubbed|Movie|Watch Online
Free, trim the title, set releaseDate to the parsed year and type to
TvTypeEnum.MOVIE, and return the IMovieResult[] so callers push/assign the
results instead of duplicating parsing logic.
- Line 370: The code unconditionally constructs serverUrl from serverData.url
which can throw for non-StreamTape servers; move the URL construction into the
StreamTape branch so serverUrl is only created when calling
streamTapeExtractor.extract(serverUrl). Update the branch that calls
streamTapeExtractor.extract to build const serverUrl = new URL(serverData.url)
just before that call and remove the unconditional const serverUrl declaration.
In `@src/providers/movies/tollywood/test.ts`:
- Line 3: The import createProviderContext is unused in the test file; remove
the unused import statement (the import of createProviderContext) from the top
of src/providers/movies/tollywood/test.ts, or if it was intended for setup,
replace the unused import by invoking createProviderContext where needed (e.g.,
in your test setup or beforeEach) so the symbol is actually used; ensure no
other references remain to avoid lint errors.
In `@test-tollywood.js`:
- Around line 17-21: The console.log currently builds the printed image string
using optional chaining then concatenation which yields "undefined..." when
latest[0].image is undefined; update the formatting in the console.log (the
block that references latest[0].id, latest[0].title, latest[0].image) to
conditionally build the truncated image string—e.g., if latest[0].image is
present return latest[0].image.substring(0,50) + '...' otherwise return
null/empty string or a sentinel like '<no image>'—so you avoid concatenating
'...' to undefined.
- Around line 1-3: Remove the unused import createProviderContext from
test-tollywood.js: locate the require that destructures createProviderContext
(const { createProviderContext } =
require('./dist/utils/create-provider-context').default;) and delete that part
so only the Tollywood provider import remains (keep the Tollywood require). This
eliminates the unused symbol createProviderContext and avoids confusing dead
imports.
🧹 Nitpick comments (3)
src/providers/movies/tollywood/create-tollywood.ts (1)
298-323: Greedy URL regex may capture unintended URLs from inline scripts.
/https?:\/\/[^"'\s<>]+/giwill match every URL in every<script>block, then the filter relies on substring checks (streamtape,vcdnlare, etc.) to keep only streaming links. This is fragile — ad-network or analytics URLs containing those substrings would produce false-positive server entries. Consider anchoring to known iframe/embed patterns or at least validating the matched URL has a recognisable streaming path segment.test-tollywood.js (1)
7-51: This is a manual console-log test script with no assertions — consider using a proper test framework instead.The script only logs output and catches errors silently. It cannot fail a CI pipeline and provides no regression safety. If this is meant for local debugging only, it should live outside the repo root (or in a
scripts/directory); if it's meant as a test, it should use the project's test runner with real assertions.src/providers/movies/tollywood/test.ts (1)
5-50: This file duplicatestest-tollywood.jsand has the same lack of assertions.Both this file and
test-tollywood.jsare console-log-only scripts with no test framework assertions. "All tests passed!" on line 43 is misleading since nothing is actually validated. Consider consolidating into a single test file using the project's test framework with real assertions (expect/assert), or remove one of the duplicates.
| { | ||
| "id": "tollywood", | ||
| "name": "Tollywood", | ||
| "description": "Telugu and Tollywood movies streaming from MovieRulz with multiple servers", | ||
| "version": "1.0.0", | ||
| "author": { | ||
| "name": "RNConsumet Team", | ||
| "url": "https://github.com/uwumilabs" | ||
| }, | ||
| "category": "movies", | ||
| "main": "https://raw.githubusercontent.com/uwumilabs/react-native-consumet/refs/heads/main/dist/providers/movies/tollywood/create-tollywood.js", | ||
| "factoryName": "createTollywood", | ||
| "baseUrl": "https://www.5movierulz.tires", | ||
| "logo": "https://www.5movierulz.tires/favicon.ico", | ||
| "languages": ["te", "hi", "en"], | ||
| "nsfw": false, | ||
| "status": "stable", | ||
| "lastUpdated": "2025-08-05T00:00:00Z", | ||
| "extractors": ["StreamTape"], | ||
| "isSourceEmbed": true, | ||
| "haveMultiServers": true | ||
| } |
There was a problem hiding this comment.
Domain stability concern: 5movierulz.tires is likely to change frequently.
MovieRulz sites are well-known for frequent domain changes. Setting "status": "stable" may be premature — consider "alpha" or "beta" to signal the inherent fragility. The baseUrl will likely need updates soon.
🤖 Prompt for AI Agents
In `@src/extension-registry.json` around lines 158 - 179, The tollywood extension
entry (id "tollywood") marks a frequently changing MovieRulz domain as "stable";
change "status" to "beta" or "alpha" to reflect fragility and add a small
metadata flag like "domainStability": "volatile" or "note": "baseUrl may change
frequently" so consumers know to expect updates, and ensure any future domain
rotations update "baseUrl" and "lastUpdated" when you replace the endpoint.
| $('div[id^="post-"]').each((_idx, el) => { | ||
| const titleElement = $(el).find('h2'); | ||
| const linkElement = $(el).find('a'); | ||
| const imageElement = $(el).find('img'); | ||
|
|
||
| const title = titleElement.text().trim(); | ||
| const url = linkElement.attr('href'); | ||
| const image = imageElement.attr('src') || imageElement.attr('data-src'); | ||
|
|
||
| const yearMatch = title.match(/\((\d{4})\)/); | ||
| const year = yearMatch ? yearMatch[1] : undefined; | ||
|
|
||
| const cleanTitle = title | ||
| .replace(/\s*\(\d{4}\)\s*/g, '') | ||
| .replace(/\s*(HDRip|DVDScr|BRRip|DVDRip|WebRip|CAM|HDTS|Telugu|Hindi|Dubbed|Movie|Watch Online Free)\s*/g, '') | ||
| .trim(); | ||
|
|
||
| if (url && cleanTitle) { | ||
| const movieId = url.replace(config.baseUrl, '').replace(/^\/+/, '').replace(/\/$/, ''); | ||
|
|
||
| searchResult.results.push({ | ||
| id: movieId, | ||
| title: cleanTitle, | ||
| url: url.startsWith('http') ? url : `${config.baseUrl}/${url}`, | ||
| image: image?.startsWith('http') ? image : undefined, | ||
| releaseDate: year, | ||
| type: TvTypeEnum.MOVIE, | ||
| }); | ||
| } | ||
| }); |
There was a problem hiding this comment.
🛠️ Refactor suggestion | 🟠 Major
Extract the shared movie-parsing logic into a helper function.
The same parsing block (find h2/a/img, extract title, clean it, build IMovieResult) is duplicated nearly verbatim across search, fetchTeluguFeatured, fetchTeluguByYear, and fetchLatestMovies. The only differences are the title-cleaning regex (which itself is inconsistently missing "Hindi" and "Dubbed" in some methods).
A single parseMovieListings($: CheerioAPI, baseUrl: string): IMovieResult[] helper would eliminate ~80 lines of duplication and ensure consistent title cleaning everywhere.
♻️ Example helper extraction
+ /**
+ * Parse movie listings from a cheerio-loaded page.
+ */
+ function parseMovieListings($: ReturnType<typeof load>): IMovieResult[] {
+ const results: IMovieResult[] = [];
+ $('div[id^="post-"]').each((_idx, el) => {
+ const title = $(el).find('h2').text().trim();
+ const url = $(el).find('a').attr('href');
+ const image = $(el).find('img').attr('src') || $(el).find('img').attr('data-src');
+
+ const yearMatch = title.match(/\((\d{4})\)/);
+ const year = yearMatch ? yearMatch[1] : undefined;
+
+ const cleanTitle = title
+ .replace(/\s*\(\d{4}\)\s*/g, '')
+ .replace(/\s*(HDRip|DVDScr|BRRip|DVDRip|WebRip|CAM|HDTS|Telugu|Hindi|Dubbed|Movie|Watch Online Free)\s*/gi, '')
+ .trim();
+
+ if (url && cleanTitle) {
+ const movieId = url.replace(config.baseUrl, '').replace(/^\/+/, '').replace(/\/$/, '');
+ results.push({
+ id: movieId,
+ title: cleanTitle,
+ url: url.startsWith('http') ? url : `${config.baseUrl}/${url}`,
+ image: image?.startsWith('http') ? image : undefined,
+ releaseDate: year,
+ type: TvTypeEnum.MOVIE,
+ });
+ }
+ });
+ return results;
+ }Also applies to: 114-143, 169-195, 456-485
🤖 Prompt for AI Agents
In `@src/providers/movies/tollywood/create-tollywood.ts` around lines 59 - 88,
Extract the repeated movie-parsing block into a single helper function, e.g.
parseMovieListings($: CheerioAPI, baseUrl: string): IMovieResult[], and replace
the duplicated code in search, fetchTeluguFeatured, fetchTeluguByYear, and
fetchLatestMovies with calls to this helper; the helper should iterate
$('div[id^="post-"]'), find h2/a/img, extract title, url and image, normalize
image to absolute only when it startsWith('http'), derive movieId by stripping
baseUrl and leading/trailing slashes, parse a four-digit year with
/\((\d{4})\)/, apply a consistent cleaning regex that includes
HDRip|DVDScr|BRRip|DVDRip|WebRip|CAM|HDTS|Telugu|Hindi|Dubbed|Movie|Watch Online
Free, trim the title, set releaseDate to the parsed year and type to
TvTypeEnum.MOVIE, and return the IMovieResult[] so callers push/assign the
results instead of duplicating parsing logic.
| if (servers.length === 0) { | ||
| servers.push({ | ||
| name: 'StreamTape', | ||
| url, | ||
| }); | ||
| } |
There was a problem hiding this comment.
Unreachable "no servers" check due to fallback.
The fallback at lines 339-344 in fetchEpisodeServers guarantees servers.length >= 1 on return. This makes the servers.length === 0 guard at line 363 in fetchEpisodeSources dead code — it will never throw.
If the intent is to surface a real "no servers found" error, the fallback should be removed (or moved into fetchEpisodeSources as a last resort), so that callers can distinguish between "found real servers" and "found nothing."
Also applies to: 362-365
🤖 Prompt for AI Agents
In `@src/providers/movies/tollywood/create-tollywood.ts` around lines 339 - 344,
The fallback that always pushes a StreamTape entry inside fetchEpisodeServers
makes the servers array never empty and thus renders the servers.length === 0
guard in fetchEpisodeSources unreachable; remove the unconditional fallback from
fetchEpisodeServers (the block that pushes { name: 'StreamTape', url }) so
fetchEpisodeServers can return an empty array when nothing was found, and if you
still want a fallback keep that logic inside fetchEpisodeSources after calling
fetchEpisodeServers (i.e., check if servers is empty there and then insert the
StreamTape fallback) so callers can distinguish "no real servers found" from
"fallback used."
| const serverData = | ||
| servers.find(s => s.name.toLowerCase() === server.toLowerCase()) || servers[0]!; | ||
|
|
||
| const serverUrl = new URL(serverData.url); |
There was a problem hiding this comment.
serverUrl is created but never used.
const serverUrl = new URL(serverData.url); allocates a URL object that is only passed to streamTapeExtractor.extract(serverUrl) on one branch, but it's constructed unconditionally. If serverData.url is malformed for non-StreamTape servers, this will throw an unhandled TypeError before reaching the correct branch.
🐛 Proposed fix: move URL construction inside the StreamTape branch
- const serverUrl = new URL(serverData.url);
-
if (serverData.url.includes('streamtape.com') || serverData.url.includes('streamtape')) {
try {
if (!StreamTape) {
throw new Error('StreamTape extractor not available');
}
const streamTapeExtractor = new StreamTape();
- const sources = await streamTapeExtractor.extract(serverUrl);
+ const sources = await streamTapeExtractor.extract(new URL(serverData.url));📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| const serverUrl = new URL(serverData.url); | |
| if (serverData.url.includes('streamtape.com') || serverData.url.includes('streamtape')) { | |
| try { | |
| if (!StreamTape) { | |
| throw new Error('StreamTape extractor not available'); | |
| } | |
| const streamTapeExtractor = new StreamTape(); | |
| const sources = await streamTapeExtractor.extract(new URL(serverData.url)); | |
| } | |
| } |
🤖 Prompt for AI Agents
In `@src/providers/movies/tollywood/create-tollywood.ts` at line 370, The code
unconditionally constructs serverUrl from serverData.url which can throw for
non-StreamTape servers; move the URL construction into the StreamTape branch so
serverUrl is only created when calling streamTapeExtractor.extract(serverUrl).
Update the branch that calls streamTapeExtractor.extract to build const
serverUrl = new URL(serverData.url) just before that call and remove the
unconditional const serverUrl declaration.
| if (serverData.url.includes('vcdnlare')) { | ||
| return { | ||
| headers: { Referer: config.baseUrl }, | ||
| sources: [ | ||
| { | ||
| url: serverData.url, | ||
| isM3U8: true, | ||
| }, | ||
| ], | ||
| }; | ||
| } | ||
|
|
||
| if (serverData.url.includes('uperbox')) { | ||
| return { | ||
| headers: { Referer: config.baseUrl }, | ||
| sources: [ | ||
| { | ||
| url: serverData.url, | ||
| isM3U8: serverData.url.includes('.m3u8'), | ||
| }, | ||
| ], | ||
| }; | ||
| } | ||
|
|
||
| if (serverData.url.includes('dropress')) { | ||
| return { | ||
| headers: { Referer: config.baseUrl }, | ||
| sources: [ | ||
| { | ||
| url: serverData.url, | ||
| isM3U8: serverData.url.includes('.m3u8'), | ||
| }, | ||
| ], | ||
| }; | ||
| } |
There was a problem hiding this comment.
All non-StreamTape server branches return a raw page URL without actual source extraction.
For vcdnlare, uperbox, dropress, and the default fallback, the code returns serverData.url directly as a video source without any extraction logic. The vcdnlare branch additionally hard-codes isM3U8: true, which may not always be correct. These stubs mean the provider effectively only works for StreamTape; the other "servers" will likely yield non-playable URLs.
Consider either implementing extraction for the additional servers or clearly documenting that only StreamTape is functional (and adjusting haveMultiServers accordingly in the registry).
🤖 Prompt for AI Agents
In `@src/providers/movies/tollywood/create-tollywood.ts` around lines 396 - 430,
The current server-branch handlers in create-tollywood.ts return serverData.url
directly (notably the vcdnlare, uperbox, dropress branches inside the code that
checks serverData.url) and even hard-code isM3U8: true for vcdnlare; implement
proper source extraction for each of these hosters (parse their actual
embed/player URLs, fetch and resolve m3u8 or direct stream links, and set isM3U8
correctly) inside the same conditional blocks that now return raw URLs, or if
you cannot support them, update the provider metadata (the registry flag
haveMultiServers) and add clear fallback behavior/logging so consumers know only
StreamTape is supported rather than returning non-playable URLs.
| @@ -0,0 +1,50 @@ | |||
| // Test file for Tollywood provider | |||
| import Tollywood from './tollywood'; | |||
| import { createProviderContext } from '../../../utils'; | |||
There was a problem hiding this comment.
Unused import: createProviderContext is imported but never used.
Proposed fix
import Tollywood from './tollywood';
-import { createProviderContext } from '../../../utils';📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| import { createProviderContext } from '../../../utils'; | |
| import Tollywood from './tollywood'; |
🤖 Prompt for AI Agents
In `@src/providers/movies/tollywood/test.ts` at line 3, The import
createProviderContext is unused in the test file; remove the unused import
statement (the import of createProviderContext) from the top of
src/providers/movies/tollywood/test.ts, or if it was intended for setup, replace
the unused import by invoking createProviderContext where needed (e.g., in your
test setup or beforeEach) so the symbol is actually used; ensure no other
references remain to avoid lint errors.
| // Simple test for Tollywood provider | ||
| const { createProviderContext } = require('./dist/utils/create-provider-context').default; | ||
| const Tollywood = require('./dist/providers/movies/tollywood/tollywood').default; |
There was a problem hiding this comment.
Unused import: createProviderContext is never referenced.
Line 2 destructures createProviderContext from the dist output but it's never used in the file. Remove it to avoid confusion.
Proposed fix
// Simple test for Tollywood provider
-const { createProviderContext } = require('./dist/utils/create-provider-context').default;
const Tollywood = require('./dist/providers/movies/tollywood/tollywood').default;📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| // Simple test for Tollywood provider | |
| const { createProviderContext } = require('./dist/utils/create-provider-context').default; | |
| const Tollywood = require('./dist/providers/movies/tollywood/tollywood').default; | |
| // Simple test for Tollywood provider | |
| const Tollywood = require('./dist/providers/movies/tollywood/tollywood').default; |
🤖 Prompt for AI Agents
In `@test-tollywood.js` around lines 1 - 3, Remove the unused import
createProviderContext from test-tollywood.js: locate the require that
destructures createProviderContext (const { createProviderContext } =
require('./dist/utils/create-provider-context').default;) and delete that part
so only the Tollywood provider import remains (keep the Tollywood require). This
eliminates the unused symbol createProviderContext and avoids confusing dead
imports.
| console.log(' First movie:', { | ||
| id: latest[0].id, | ||
| title: latest[0].title, | ||
| image: latest[0].image?.substring(0, 50) + '...', | ||
| }); |
There was a problem hiding this comment.
String concatenation with potentially undefined value yields "undefined...".
When latest[0].image is undefined, the optional chain returns undefined, and undefined + '...' produces the string "undefined...".
Proposed fix
- image: latest[0].image?.substring(0, 50) + '...',
+ image: latest[0].image ? latest[0].image.substring(0, 50) + '...' : 'N/A',🤖 Prompt for AI Agents
In `@test-tollywood.js` around lines 17 - 21, The console.log currently builds the
printed image string using optional chaining then concatenation which yields
"undefined..." when latest[0].image is undefined; update the formatting in the
console.log (the block that references latest[0].id, latest[0].title,
latest[0].image) to conditionally build the truncated image string—e.g., if
latest[0].image is present return latest[0].image.substring(0,50) + '...'
otherwise return null/empty string or a sentinel like '<no image>'—so you avoid
concatenating '...' to undefined.
There was a problem hiding this comment.
Pull request overview
This pull request adds a new Tollywood movie provider to the react-native-consumet library, enabling users to stream Telugu, Hindi, and English movies from the 5movierulz.tires website. The provider follows the established architectural pattern used by other movie providers in the codebase, implementing both a functional factory pattern (create-tollywood.ts) and a wrapper class (tollywood.ts) for backward compatibility.
Changes:
- Added new Tollywood provider supporting Telugu/Tollywood movie streaming with multi-server support (StreamTape, VcdnLare, UperBox, DoodStream, etc.)
- Integrated provider into the existing infrastructure through provider maps, index files, and extension registry
- Included test files demonstrating provider functionality (though not following established conventions)
Reviewed changes
Copilot reviewed 7 out of 33 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| src/providers/movies/tollywood/create-tollywood.ts | Core provider implementation with search, media info, and streaming source extraction |
| src/providers/movies/tollywood/tollywood.ts | Backward-compatible wrapper class extending MovieParser |
| src/providers/movies/tollywood/test.ts | Test file demonstrating provider usage (non-standard location) |
| test-tollywood.js | Root-level test script for provider validation |
| src/providers/movies/index.ts | Added Tollywood imports and exports |
| src/utils/provider-maps.ts | Registered Tollywood provider in movie providers map |
| src/extension-registry.json | Added provider metadata for extension system |
| dist/* | Compiled JavaScript output and type definitions |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| }; | ||
|
|
||
| /** | ||
| * Fetch Telugu featured movies |
There was a problem hiding this comment.
The JSDoc comment is missing parameter descriptions. It should include @param page with a description following the codebase convention seen in other providers.
| * Fetch Telugu featured movies | |
| * Fetch Telugu featured movies | |
| * | |
| * @param page - The page number of featured movies to fetch |
| }; | ||
|
|
||
| /** | ||
| * Fetch media info for a movie |
There was a problem hiding this comment.
The JSDoc comment is missing parameter descriptions. It should include @param mediaId with a description following the codebase convention.
| * Fetch media info for a movie | |
| * Fetch media info for a movie | |
| * @param mediaId Identifier or URL path for the movie whose media info should be fetched. |
| /** | ||
| * Fetch episode sources (actual video URLs) | ||
| */ | ||
| const fetchEpisodeSources = async ( | ||
| episodeId: string, | ||
| mediaId: string, | ||
| server: StreamingServers = StreamingServersEnum.StreamTape | ||
| ): Promise<ISource> => { |
There was a problem hiding this comment.
| match.includes('mixdrop') || | ||
| match.includes('dood') | ||
| ) { | ||
| const cleanUrl = match.replace(/[,\s"'"]$/, ''); |
There was a problem hiding this comment.
The regex pattern contains an error: it has both a single quote and a double quote character inside the character class, resulting in [,\s"'"] which includes an extra quote. This should be [,\s"'] to properly match commas, whitespace, single quotes, or double quotes at the end of the URL string.
| const cleanUrl = match.replace(/[,\s"'"]$/, ''); | |
| const cleanUrl = match.replace(/[,\s"']$/, ''); |
| const supportedTypes = new Set([TvTypeEnum.MOVIE]); | ||
|
|
||
| /** | ||
| * Search for Telugu/Tollywood movies |
There was a problem hiding this comment.
The JSDoc comment is missing parameter descriptions. Based on patterns in the codebase (e.g., himovies/create-himovies.ts), JSDoc comments for provider methods should include parameter descriptions using @param tags. For example, this should include @param query and @param page with their descriptions.
| * Search for Telugu/Tollywood movies | |
| * Search for Telugu/Tollywood movies. | |
| * | |
| * @param query The search query string used to find matching Telugu/Tollywood movies. | |
| * @param page The page number of search results to retrieve (defaults to 1). |
| } | ||
|
|
||
| /** | ||
| * Fetch episode servers (streaming sources) |
There was a problem hiding this comment.
The JSDoc comment is missing parameter descriptions. It should include @param episodeId and @param _mediaId with descriptions following the codebase convention seen in other providers (e.g., himovies/create-himovies.ts lines 243-246).
| * Fetch episode servers (streaming sources) | |
| * Fetch episode servers (streaming sources) | |
| * @param episodeId - Episode identifier or URL used to fetch streaming servers. | |
| * @param _mediaId - Parent movie/media identifier (accepted for interface compatibility, not used). |
| @@ -0,0 +1,50 @@ | |||
| // Test file for Tollywood provider | |||
| import Tollywood from './tollywood'; | |||
| import { createProviderContext } from '../../../utils'; | |||
There was a problem hiding this comment.
The import createProviderContext is unused in this test file. It should be removed to keep the imports clean.
| import { createProviderContext } from '../../../utils'; |
|
|
||
| $('iframe').each((_idx, el) => { | ||
| const src = $(el).attr('src'); | ||
| if (src && (src.includes('streamtape') || src.includes('vcdnlare') || src.includes('uperbox') || src.includes('dropress'))) { |
There was a problem hiding this comment.
The iframe server filtering is inconsistent with the script-based filtering above. The script-based filtering checks for 'vidshare', 'mixdrop', and 'dood' (lines 309-311), but the iframe filtering does not include these servers. This inconsistency means iframe sources for these servers will not be detected. Either add these servers to the iframe filtering condition, or document why they are intentionally excluded.
| if (src && (src.includes('streamtape') || src.includes('vcdnlare') || src.includes('uperbox') || src.includes('dropress'))) { | |
| if ( | |
| src && | |
| ( | |
| src.includes('streamtape') || | |
| src.includes('vcdnlare') || | |
| src.includes('uperbox') || | |
| src.includes('dropress') || | |
| src.includes('vidshare') || | |
| src.includes('mixdrop') || | |
| src.includes('dood') | |
| ) | |
| ) { |
| // Test file for Tollywood provider | ||
| import Tollywood from './tollywood'; | ||
| import { createProviderContext } from '../../../utils'; | ||
|
|
||
| async function testTollywood() { | ||
| console.log('Testing Tollywood Provider...'); | ||
|
|
||
| const provider = new Tollywood(); | ||
|
|
||
| try { | ||
| // Test 1: Fetch latest movies | ||
| console.log('\n=== Test 1: Fetch Latest Movies ==='); | ||
| const latestMovies = await provider.fetchLatestMovies(); | ||
| console.log(`Found ${latestMovies.length} movies`); | ||
| if (latestMovies.length > 0) { | ||
| console.log('First movie:', latestMovies[0]); | ||
| } | ||
|
|
||
| // Test 2: Fetch Telugu featured | ||
| console.log('\n=== Test 2: Fetch Telugu Featured ==='); | ||
| const featured = await provider.fetchTeluguFeatured(1); | ||
| console.log(`Found ${featured.results.length} featured movies`); | ||
| console.log(`Has next page: ${featured.hasNextPage}`); | ||
|
|
||
| // Test 3: Search | ||
| console.log('\n=== Test 3: Search ==='); | ||
| const searchResults = await provider.search('Baahubali'); | ||
| console.log(`Found ${searchResults.results.length} search results`); | ||
|
|
||
| // Test 4: Fetch media info | ||
| if (latestMovies.length > 0) { | ||
| console.log('\n=== Test 4: Fetch Media Info ==='); | ||
| const movieId = latestMovies[0]!.id; | ||
| console.log(`Fetching info for: ${movieId}`); | ||
| const mediaInfo = await provider.fetchMediaInfo(movieId); | ||
| console.log('Media info:', { | ||
| title: mediaInfo.title, | ||
| genres: mediaInfo.genres, | ||
| type: mediaInfo.type, | ||
| }); | ||
| } | ||
|
|
||
| console.log('\n=== All tests passed! ==='); | ||
| } catch (error) { | ||
| console.error('Test failed:', error); | ||
| } | ||
| } | ||
|
|
||
| // Run tests | ||
| testTollywood(); |
There was a problem hiding this comment.
Based on the codebase convention, provider test files should be located in the test/movies directory following the pattern used by other providers (e.g., test/movies/yflix.test.ts, test/movies/himovies.test.ts). The test files in src/providers/movies/tollywood/test.ts and the root test-tollywood.js don't follow this convention and should be moved/refactored to test/movies/tollywood.test.ts with proper Jest test structure using describe and test blocks.
| @@ -0,0 +1,55 @@ | |||
| // Simple test for Tollywood provider | |||
| const { createProviderContext } = require('./dist/utils/create-provider-context').default; | |||
There was a problem hiding this comment.
Unused variable createProviderContext.
Pull Request Description
Please provide a clear and concise description of the changes introduced by this pull request. Explain the what and why behind your changes.
Closes #[issue_number] (if applicable)
Type of Change
Please check the type of change your PR introduces:
Breaking Change
Does this PR introduce a breaking change?
If 'Yes', please describe the impact and migration path for existing applications:
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration.
yarn test)Test Configuration:
Screenshots / Gifs (Optional)
If your changes include UI updates or visual enhancements, please provide screenshots or GIFs here.
PR Checklist
Before submitting your pull request, please ensure the following:
yarn lintandyarn format).yarn build) and confirmed no issues.Further Comments / Notes (Optional)
Add any additional context or notes about the pull request here.
Summary by CodeRabbit