Skip to content

Support PumpYourSound fangates over Bandcamp store links - #100

Merged
D3SOX merged 3 commits into
masterfrom
pumpyoursound-support
Aug 9, 2026
Merged

Support PumpYourSound fangates over Bandcamp store links#100
D3SOX merged 3 commits into
masterfrom
pumpyoursound-support

Conversation

@D3SOX

@D3SOX D3SOX commented Aug 9, 2026

Copy link
Copy Markdown
Owner

Summary

  • Recognize PumpYourSound fangate URLs and prefer them (and other traditional gates) over Bandcamp/SoundCloud store links when both appear on a track
  • Add a PumpYourSound browser downloader (SoundCloud OAuth, social mark-complete, comment, then downloadLink via DirectDownloader)
  • Verified end-to-end on https://soundcloud.com/larry-lars-328906221/aguanile-groove-hector-lavoe → ~10 MB MP3 from the gated Drive link

Test plan

  • Load the Larry Lars track above and confirm the resolved gate is PumpYourSound (description), not Bandcamp purchase_url
  • Run a download with SoundCloud cookies / Initialize Logins so OAuth Allow succeeds
  • Confirm the file lands in ./downloads (Drive/direct link after fangate unlock)
  • bun test src/utils.test.ts

Summary by CodeRabbit

  • New Features
    • Added PumpYourSound support for detecting, validating, and downloading gated audio.
    • Supports login preparation, social verification, email forms, OAuth, and download progress.
    • Added PumpYourSound across the app, server, browser extension, and web interface.
  • Bug Fixes
    • Gate links in track descriptions now take precedence over store links.
  • Documentation
    • Updated supported-provider and setup documentation with PumpYourSound details.

Prefer traditional gates in the track description (e.g. PumpYourSound)
when purchase_url points at Bandcamp, and unlock PYS via SoundCloud
OAuth plus the fangate downloadLink redirect.
@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 6bd1c345-d65e-48a5-a8b8-5a532cb30775

📥 Commits

Reviewing files that changed from the base of the PR and between ffb2fec and d8fd405.

📒 Files selected for processing (1)
  • src/pumpyoursound.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/pumpyoursound.ts

📝 Walkthrough

Walkthrough

Adds PumpYourSound URL detection, a Puppeteer-based gate downloader, CLI and server routing, progress and cancellation handling, tests, userscript recognition, and documentation updates.

Changes

PumpYourSound support

Layer / File(s) Summary
Gate recognition and extraction
src/utils.ts, src/utils.test.ts, src/soundcloud.ts, userscript/sc-gate-dl.user.js
Adds the pumpyoursound provider, URL matching, HTTPS normalization, extraction precedence, provider labeling, userscript recognition, and utility coverage.
PumpYourSound browser downloader
src/pumpyoursound.ts
Adds browser initialization, SoundCloud OAuth handling, social and comment steps, optional email forms, redirect extraction, progress reporting, timeout handling, and cleanup.
Download workflow routing
src/index.ts, src/server.ts
Routes PumpYourSound downloads through the CLI and server workflows with login preparation, progress callbacks, cancellation checks, and browser cleanup.
Documentation and interface support
README.md, webui/src/components/App.tsx
Adds PumpYourSound to supported-source descriptions, prompts, notices, examples, and gate URL precedence documentation.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant DownloadFlow
  participant PumpyoursoundDownloader
  participant SoundCloud
  participant DirectDownloader
  Client->>DownloadFlow: submit PumpYourSound URL
  DownloadFlow->>PumpyoursoundDownloader: initialize downloader
  PumpyoursoundDownloader->>SoundCloud: complete OAuth and gate steps
  SoundCloud-->>PumpyoursoundDownloader: provide completed gate state
  PumpyoursoundDownloader->>DirectDownloader: pass resolved download link
  DirectDownloader-->>DownloadFlow: return downloaded filename
  DownloadFlow-->>Client: report progress and completion
Loading

Possibly related PRs

  • D3SOX/sc-gate-dl#85: Adds a related Puppeteer-based gate downloader across shared routing and downloader workflows.
  • D3SOX/sc-gate-dl#90: Provides the DirectDownloader flow reused by the PumpYourSound downloader.
  • D3SOX/sc-gate-dl#97: Adds another browser-based SoundCloud gate provider across the same integration points.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 27.27% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the primary change: prioritizing PumpYourSound fangates over Bandcamp store links.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch pumpyoursound-support

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

DirectDownloader marks progress as browserless, which hid the Web UI
cleanup prompt even though the gate already used SoundCloud OAuth.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/pumpyoursound.ts`:
- Around line 45-56: Update initialize() around
loadCookies('soundcloud-cookies.json') to catch failures from missing or
malformed cookie files and report clearly that the user must export the
SoundCloud cookie file before running the downloader. Preserve setting the
cookies through browserContext.setCookie for successfully loaded cookies.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 5366e466-4832-4c8b-9575-cf05ce49c86a

📥 Commits

Reviewing files that changed from the base of the PR and between 21c370c and f88d714.

📒 Files selected for processing (9)
  • README.md
  • src/index.ts
  • src/pumpyoursound.ts
  • src/server.ts
  • src/soundcloud.ts
  • src/utils.test.ts
  • src/utils.ts
  • userscript/sc-gate-dl.user.js
  • webui/src/components/App.tsx

Comment thread src/pumpyoursound.ts

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
src/pumpyoursound.ts (2)

277-297: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Fail fast when the comment input is absent.

The code clicks #fangate-send-comment even when neither comment-input selector matches. This can submit an empty comment or leave the step incomplete while completeSoundcloudOauth waits for up to 180 seconds. Require the input before clicking the send control.

Proposed fix
 const input = document.querySelector<HTMLInputElement>(
 	'input[name="fangate_comment"], input.fangatex__icomment',
 );
-if (input) {
-	input.value = text;
-	input.dispatchEvent(new Event('input', { bubbles: true }));
-	input.dispatchEvent(new Event('change', { bubbles: true }));
+if (!input) {
+	throw new Error('PumpYourSound comment input not found.');
 }
+input.value = text;
+input.dispatchEvent(new Event('input', { bubbles: true }));
+input.dispatchEvent(new Event('change', { bubbles: true }));
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/pumpyoursound.ts` around lines 277 - 297, Update the page.evaluate
comment-submission flow to throw immediately when no comment input matches
either selector, before modifying or clicking `#fangate-send-comment`. Only
proceed with setting the input value, updating the send link, and clicking the
control when the input exists.

173-179: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Implement Twitter completion before declaring it supported.

needSocial treats twitter as a required step, but handleSocialMarkComplete has no Twitter selector. The cleanup loop also does not close twitter.com pages. A Twitter gate therefore reaches this branch, returns false, and throws at Lines 200-205. Add the actual Twitter completion selector and popup cleanup, or remove twitter from the supported kinds until implemented.

Also applies to: 440-448, 480-483

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/pumpyoursound.ts` around lines 173 - 179, Implement Twitter support
consistently across the social flow: add a Twitter completion selector to
handleSocialMarkComplete, and include twitter.com pages in the popup cleanup
loop. Ensure Twitter gates can complete successfully instead of reaching the
unsupported failure branch; otherwise remove twitter from the supported-kind
checks in needSocial and the corresponding logic at the additional locations.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@src/pumpyoursound.ts`:
- Around line 277-297: Update the page.evaluate comment-submission flow to throw
immediately when no comment input matches either selector, before modifying or
clicking `#fangate-send-comment`. Only proceed with setting the input value,
updating the send link, and clicking the control when the input exists.
- Around line 173-179: Implement Twitter support consistently across the social
flow: add a Twitter completion selector to handleSocialMarkComplete, and include
twitter.com pages in the popup cleanup loop. Ensure Twitter gates can complete
successfully instead of reaching the unsupported failure branch; otherwise
remove twitter from the supported-kind checks in needSocial and the
corresponding logic at the additional locations.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 9e5121f6-a596-4329-8e65-afbf04b9a01e

📥 Commits

Reviewing files that changed from the base of the PR and between f88d714 and ffb2fec.

📒 Files selected for processing (1)
  • src/pumpyoursound.ts

…social

Avoid clicking send without a comment field, and surface Twitter fangate
steps as unsupported until mark-complete selectors exist.
@D3SOX

D3SOX commented Aug 9, 2026

Copy link
Copy Markdown
Owner Author

Addressed CodeRabbit’s outside-diff notes on src/pumpyoursound.ts:

  • Comment step now throws immediately when the comment input is missing (before clicking send).
  • Removed twitter from the handled social kinds so incomplete Twitter steps fail as unsupported instead of a misleading mark-complete miss. Full Twitter support can land once we have live selectors.

@D3SOX
D3SOX merged commit 63a09b1 into master Aug 9, 2026
2 checks passed
@D3SOX
D3SOX deleted the pumpyoursound-support branch August 9, 2026 10:39
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