feat: add Music category with TPB and 1337x sources#46
Closed
Manak-hash wants to merge 2 commits into
Closed
Conversation
macOS mDNSResponder permanently occupies UDP port 5350, which is the NAT-PMP client port that webtorrent binds when initializing its NAT traversal. The bind fails asynchronously with EADDRINUSE, and since the PMP client is a raw EventEmitter with no error listener, it surfaces as an uncaughtException that kills the app the moment a download starts. NAT-PMP can never succeed on macOS because the port is permanently taken, so disable it on darwin only and let UPnP handle NAT traversal instead. Other platforms are unaffected. Closes baairon#22
Adds music torrent search alongside the existing Games, Movies, TV, and Anime categories. Two sources, both zero-setup (no login): - The Pirate Bay (apibay.org JSON API): audio categories 100-199, browse via precompiled top-100 audio list. Native JSON, magnet links built from info_hash with the shared tracker list. - 1337x Music: reuses the existing HTML scraping infrastructure from the Movies/TV sources, targeting the /category-search/.../Music/ URL pattern. Each source mirrors its Movies/TV counterpart exactly: - tpbMusic reuses piratebay.ts search() with MUSIC_CATS filter - x1337Music reuses x1337.ts search() with the Music category slug No new state, no new keys, no new UI surface beyond the sidebar entry. Closes baairon#40
Owner
|
Thanks Manak, the implementation follows the grain nicely, but Music stays out of scope: it's a tiny slice of what people actually torrent, and torlink's promise is a short list of sources I can vouch for, which TPB and 1337x audio aren't. |
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.
What and why
torlink covers Games, Movies, TV, and Anime but not Music. This PR adds Music as a fifth category, sourced from The Pirate Bay and 1337x — both zero-setup, no login required.
Sources
The Pirate Bay (
tpb-music): Uses the existingapibay.orgJSON API with audio category filtering (100-199: Music, FLAC, Audio Books, Sound Clips, Audio Other). Browse (empty query) hits the precompileddata_top100_100.jsontop-100 audio list. Magnets are built frominfo_hashvia the sharedbuildMagnethelper — identical to how Movies/TV already work.1337x (
x1337-music): Reuses the existing HTML scraping inx1337.ts, targeting/category-search/{query}/Music/1/for search and/popular-musicfor browse. The category slug was extended from"Movies" | "TV"to include"Music", with a clean ternary for the browse path.What was NOT added
Design choices
Each source mirrors its Movies/TV counterpart exactly — same
search()function, same parsing, same error handling. No new state, no new keys, no new UI patterns. The sidebar picks up "Music" automatically fromCATEGORIES.Checklist
npm run typecheckis cleannpm testpasses (97/97, including 4 new tests)feat:)Closes #40