Skip to content

feat: hotstar login another device#22

Merged
WINOFFRG merged 1 commit intomasterfrom
feat/plugin-cookie
Mar 8, 2026
Merged

feat: hotstar login another device#22
WINOFFRG merged 1 commit intomasterfrom
feat/plugin-cookie

Conversation

@WINOFFRG
Copy link
Copy Markdown
Owner

@WINOFFRG WINOFFRG commented Mar 8, 2026

Summary by CodeRabbit

  • New Features

    • Added a login transfer feature for Hotstar, enabling users to export and import login sessions across devices. Users can generate an encoded payload, copy it to clipboard, and import on another device to bypass device limitations.
  • Chores

    • Disabled pre-commit and pre-push hooks.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 8, 2026

📝 Walkthrough

Walkthrough

This PR implements a login transfer feature for Hotstar that allows users to export authentication cookies as an encoded payload and import them on separate devices. It adds cookie transfer utility modules, updates the OTT modal UI with export/import workflows, introduces new background message handlers, and enables the cookies permission in the manifest.

Changes

Cohort / File(s) Summary
Changeset & Configuration
.changeset/quick-yaks-feel.md, wxt.config.ts
Adds patch entry for OTTPRO login transfer feature and grants "cookies" permission to the manifest.
Cookie Transfer Core Library
src/lib/cookie-transfer.ts, src/lib/cookie-transfer-background.ts
Introduces cookie serialization, encoding/decoding with UTF-8 base64, validation, and backward compatibility; implements exportCookies and importCookies handlers for browser cookie operations with error tracking.
Messaging Layer
src/lib/messaging.ts, src/entrypoints/background.ts
Adds StorageMessageType.EXPORT_COOKIES and IMPORT_COOKIES types with request/response mappings; registers corresponding background message handlers.
UI Implementation
src/components/OTTModal.tsx
Adds Hotstar login transfer UI with export/import workflow states, handlers for copying payload to clipboard, importing sessions, and new "Login Another Device" section with transfer options and feedback messages.
Build Hooks
lefthook.yml
Comments out pre-commit and pre-push hook blocks, disabling both hooks without removing configuration.

Sequence Diagram(s)

sequenceDiagram
    participant User as User
    participant UI as OTTModal UI
    participant Bg as Background Worker
    participant API as Browser Cookies API

    rect rgba(100, 150, 200, 0.5)
        Note over User,API: Export Flow
        User->>UI: Click "Export Login"
        UI->>Bg: Send EXPORT_COOKIES message
        Bg->>API: Query cookies for Hotstar URL
        API-->>Bg: Return cookie list
        Bg->>Bg: Filter, serialize, encode payload
        Bg-->>UI: Return encoded payload
        UI->>UI: Display payload & copy button
        User->>UI: Copy to clipboard
    end

    rect rgba(150, 100, 200, 0.5)
        Note over User,API: Import Flow (on new device)
        User->>UI: Paste payload & click "Import"
        UI->>Bg: Send IMPORT_COOKIES message + payload
        Bg->>Bg: Decode & validate payload
        Bg->>API: Set each cookie
        API-->>Bg: Confirm cookie set
        Bg-->>UI: Return import results
        UI->>UI: Display success/failure feedback
    end
Loading

Estimated Code Review Effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐰 A rabbit hops with cookies in hand,
Exporting transfers across the land,
Base64 magic makes the payload fly,
One device to another, under the sky,
Hotstar login transfer—now that's swell! 🎬

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'feat: hotstar login another device' accurately describes the main feature addition—a new login transfer workflow for Hotstar that allows users to login on another device by exporting and importing cookies.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/plugin-cookie

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (1)
src/lib/cookie-transfer-background.ts (1)

98-100: Consider logging failed cookie errors for debugging.

The error is silently swallowed, making it difficult to diagnose why specific cookies failed to import. Adding a debug log would help troubleshoot issues.

     } catch {
+      // Consider: logger.debug("Failed to import cookie", { name: cookie.name, error });
       failedCookies.push(cookie.name);
     }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/lib/cookie-transfer-background.ts` around lines 98 - 100, The catch block
currently swallows errors and only calls failedCookies.push(cookie.name); update
the catch to log the error (e.g., console.error or your module logger) including
cookie.name and the caught error so failures are visible for debugging;
specifically modify the catch around failedCookies.push(cookie.name) in
src/lib/cookie-transfer-background.ts to accept an error parameter (catch (err)
{ ... }) and emit a clear log message before pushing the cookie name to
failedCookies.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.changeset/quick-yaks-feel.md:
- Line 5: The changelog entry contains a typo: update the commit message string
"feat: login trasfer on hotstar" to correct spelling by replacing "trasfer" with
"transfer" so it reads "feat: login transfer on hotstar".

In `@lefthook.yml`:
- Around line 1-11: The lefthook.yml currently has the pre-commit and pre-push
blocks commented out, disabling automated Biome lint checks; restore the
pre-commit and pre-push sections by uncommenting the blocks for the "check"
command(s) (the pre-commit "check" using npx `@biomejs/biome` with {staged_files}
and stage_fixed: true, and the pre-push "check" using bunx `@biomejs/biome` with
{push_files}) or, if disabling is intentional, add a top-line comment or PR note
confirming that decision; ensure the commands (check, glob pattern, run,
stage_fixed) are exactly present in lefthook.yml so hooks run on commit/push as
intended.

In `@src/components/OTTModal.tsx`:
- Line 292: Fix the button label typo in the OTTModal component: inside the JSX
that renders the import button (the conditional using isTransferBusy), remove
the extra spaces in the fallback string so it reads "Import Session" instead of
"Import   Session" to ensure consistent button text when isTransferBusy is
false.

---

Nitpick comments:
In `@src/lib/cookie-transfer-background.ts`:
- Around line 98-100: The catch block currently swallows errors and only calls
failedCookies.push(cookie.name); update the catch to log the error (e.g.,
console.error or your module logger) including cookie.name and the caught error
so failures are visible for debugging; specifically modify the catch around
failedCookies.push(cookie.name) in src/lib/cookie-transfer-background.ts to
accept an error parameter (catch (err) { ... }) and emit a clear log message
before pushing the cookie name to failedCookies.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 0d48fe06-b689-468c-a05e-6f502aca038c

📥 Commits

Reviewing files that changed from the base of the PR and between 5fd091d and 29a64c5.

📒 Files selected for processing (8)
  • .changeset/quick-yaks-feel.md
  • lefthook.yml
  • src/components/OTTModal.tsx
  • src/entrypoints/background.ts
  • src/lib/cookie-transfer-background.ts
  • src/lib/cookie-transfer.ts
  • src/lib/messaging.ts
  • wxt.config.ts

"OTTPRO": patch
---

feat: login trasfer on hotstar
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Typo: "trasfer" → "transfer"

-feat: login trasfer on hotstar
+feat: login transfer on hotstar
📝 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.

Suggested change
feat: login trasfer on hotstar
feat: login transfer on hotstar
🧰 Tools
🪛 LanguageTool

[grammar] ~5-~5: Ensure spelling is correct
Context: --- "OTTPRO": patch --- feat: login trasfer on hotstar

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.changeset/quick-yaks-feel.md at line 5, The changelog entry contains a
typo: update the commit message string "feat: login trasfer on hotstar" to
correct spelling by replacing "trasfer" with "transfer" so it reads "feat: login
transfer on hotstar".

Comment thread lefthook.yml
Comment on lines +1 to +11
# pre-commit:
# commands:
# check:
# glob: "*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc}"
# run: npx @biomejs/biome check --write --no-errors-on-unmatched --files-ignore-unknown=true --colors=off {staged_files}
# stage_fixed: true
# pre-push:
# commands:
# check:
# glob: "*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc}"
# run: bunx @biomejs/biome check --no-errors-on-unmatched --files-ignore-unknown=true --colors=off {push_files}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

All git hooks are disabled.

Commenting out pre-commit and pre-push hooks removes automated quality checks (Biome linting). Consider re-enabling before merging to master, or confirm this is intentional.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lefthook.yml` around lines 1 - 11, The lefthook.yml currently has the
pre-commit and pre-push blocks commented out, disabling automated Biome lint
checks; restore the pre-commit and pre-push sections by uncommenting the blocks
for the "check" command(s) (the pre-commit "check" using npx `@biomejs/biome` with
{staged_files} and stage_fixed: true, and the pre-push "check" using bunx
`@biomejs/biome` with {push_files}) or, if disabling is intentional, add a
top-line comment or PR note confirming that decision; ensure the commands
(check, glob pattern, run, stage_fixed) are exactly present in lefthook.yml so
hooks run on commit/push as intended.

onClick={handleImportSession}
type="button"
>
{isTransferBusy ? "Importing..." : "Import Session"}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Typo: Extra spaces in button text.

-                        {isTransferBusy ? "Importing..." : "Import   Session"}
+                        {isTransferBusy ? "Importing..." : "Import Session"}
📝 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.

Suggested change
{isTransferBusy ? "Importing..." : "Import Session"}
{isTransferBusy ? "Importing..." : "Import Session"}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/OTTModal.tsx` at line 292, Fix the button label typo in the
OTTModal component: inside the JSX that renders the import button (the
conditional using isTransferBusy), remove the extra spaces in the fallback
string so it reads "Import Session" instead of "Import   Session" to ensure
consistent button text when isTransferBusy is false.

@WINOFFRG WINOFFRG merged commit 8a7e320 into master Mar 8, 2026
1 check passed
@github-actions github-actions Bot mentioned this pull request Mar 8, 2026
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.

1 participant