Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect un-escaped streaming URLs and redirect to correctly escaped equivalents #200

Open
omgbox opened this issue Jul 24, 2021 · 3 comments
Labels
bug Something isn't working
Milestone

Comments

@omgbox
Copy link

omgbox commented Jul 24, 2021

KiraLT on version v1.8.1 , how can I stream without using swagger to format my URL or go through the web interface, normally I am just typing in a terminal window to stream with the old version of torrent-stream-server , I'm now trying to stream with the V1.8.1 but it's not working as before.

Unformatted magnet does not work in the terminal

This example will not work in the browser or the terminal:

wget "http://127.0.0.1:3000/stream/magnet:?xt=urn:btih:AW33KWPZYIUTNTMU3EDSS2GAGIIXRA7W&dn=%5BSubsPlease%5D%20Re-Main%20-%2003%20%28720p%29%20%5B9EB549CE%5D.mkv&xl=639042804&tr=http%3A%2F%2Fnyaa.tracker.wf%3A7777%2Fannounce&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337%2Fannounce&tr=udp%3A%2F%2F9.rarbg.to%3A2710%2Fannounce&tr=udp%3A%2F%2F9.rarbg.me%3A2710%2Fannounce&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.internetwarriors.net%3A1337%2Fannounce&tr=udp%3A%2F%2Ftracker.cyberia.is%3A6969%2Fannounce&tr=udp%3A%2F%2Fexodus.desync.com%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker3.itzmx.com%3A6961%2Fannounce&tr=udp%3A%2F%2Ftracker.torrent.eu.org%3A451%2Fannounce&tr=udp%3A%2F%2Ftracker.tiny-vps.com%3A6969%2Fannounce&tr=udp%3A%2F%2Fretracker.lanta-net.ru%3A2710%2Fannounce&tr=http%3A%2F%2Fopen.acgnxtracker.com%3A80%2Fannounce&tr=wss%3A%2F%2Ftracker.openwebtorrent.com"

Formatted URL from swagger which works in terminal and browser:

wget "http://127.0.0.1:3000/stream/magnet%3A%3Fxt%3Durn%3Abtih%3AAW33KWPZYIUTNTMU3EDSS2GAGIIXRA7W%26dn%3D%255BSubsPlease%255D%2520Re-Main%2520-%252003%2520%2528720p%2529%2520%255B9EB549CE%255D.mkv%26xl%3D639042804%26tr%3Dhttp%253A%252F%252Fnyaa.tracker.wf%253A7777%252Fannounce%26tr%3Dudp%253A%252F%252Ftracker.coppersurfer.tk%253A6969%252Fannounce%26tr%3Dudp%253A%252F%252Ftracker.opentrackr.org%253A1337%252Fannounce%26tr%3Dudp%253A%252F%252F9.rarbg.to%253A2710%252Fannounce%26tr%3Dudp%253A%252F%252F9.rarbg.me%253A2710%252Fannounce%26tr%3Dudp%253A%252F%252Ftracker.leechers-paradise.org%253A6969%252Fannounce%26tr%3Dudp%253A%252F%252Ftracker.internetwarriors.net%253A1337%252Fannounce%26tr%3Dudp%253A%252F%252Ftracker.cyberia.is%253A6969%252Fannounce%26tr%3Dudp%253A%252F%252Fexodus.desync.com%253A6969%252Fannounce%26tr%3Dudp%253A%252F%252Ftracker3.itzmx.com%253A6961%252Fannounce%26tr%3Dudp%253A%252F%252Ftracker.torrent.eu.org%253A451%252Fannounce%26tr%3Dudp%253A%252F%252Ftracker.tiny-vps.com%253A6969%252Fannounce%26tr%3Dudp%253A%252F%252Fretracker.lanta-net.ru%253A2710%252Fannounce%26tr%3Dhttp%253A%252F%252Fopen.acgnxtracker.com%253A80%252Fannounce%26tr%3Dwss%253A%252F%252Ftracker.openwebtorrent.com?fileType=video"

Unformatted URL

Error reported in url {"error":"Unknown query parameter 'xt'"}:

wget "http://127.0.0.1:3000/stream/magnet:?xt=urn:btih:AW33KWPZYIUTNTMU3EDSS2GAGIIXRA7W&dn=%5BSubsPlease%5D%20Re-Main%20-%2003%20%28720p%29%20%5B9EB549CE%5D.mkv&xl=639042804&tr=http%3A%2F%2Fnyaa.tracker.wf%3A7777%2Fannounce&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337%2Fannounce&tr=udp%3A%2F%2F9.rarbg.to%3A2710%2Fannounce&tr=udp%3A%2F%2F9.rarbg.me%3A2710%2Fannounce&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.internetwarriors.net%3A1337%2Fannounce&tr=udp%3A%2F%2Ftracker.cyberia.is%3A6969%2Fannounce&tr=udp%3A%2F%2Fexodus.desync.com%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker3.itzmx.com%3A6961%2Fannounce&tr=udp%3A%2F%2Ftracker.torrent.eu.org%3A451%2Fannounce&tr=udp%3A%2F%2Ftracker.tiny-vps.com%3A6969%2Fannounce&tr=udp%3A%2F%2Fretracker.lanta-net.ru%3A2710%2Fannounce&tr=http%3A%2F%2Fopen.acgnxtracker.com%3A80%2Fannounce&tr=wss%3A%2F%2Ftracker.openwebtorrent.com

Any advice, I am still with the old torrent-stream-server, I do not really visit the WebUI to do streaming.

@KiraLT
Copy link
Owner

KiraLT commented Jul 29, 2021

Normally you can't support these URLs because of URL standards, but I will try adding redirect the next week.

@KiraLT KiraLT added the bug Something isn't working label Jul 29, 2021
@omgbox
Copy link
Author

omgbox commented Jul 30, 2021

Normally you can't support these URLs because of URL standards, but I will try adding redirect the next week.

that will be extremely welcomed, thank you.

@omgbox omgbox closed this as completed Jul 30, 2021
@KiraLT KiraLT changed the title how to do a Correct URL formatting Detect un-escaped streaming URLs and redirect to correctly escaped equivalents Oct 10, 2021
@KiraLT KiraLT reopened this Oct 10, 2021
@KiraLT
Copy link
Owner

KiraLT commented Oct 10, 2021

It is a lot harder to implement it correctly than I thought, but it would be useful to implement this feature.

Current plans:

  • Ability to create ExpressJS app without running
  • Lazy app loadings- app creation should be synchronous, add lazy loading to the torrent client
  • Add tests support with supertest
  • Create a new router for custom redirects, initialize before OpenAPI validator
  • Detect unescaped magnet links in stream & playlist URLs and redirect to escaped equivalents
  • Detect unescaped torrent links in stream & playlist URLs and redirect to escaped equivalents

@KiraLT KiraLT added this to the v1.10.0 milestone Oct 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants