Detect un-escaped streaming URLs and redirect to correctly escaped equivalents
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.
Normally you can't support these URLs because of URL standards, but I will try adding redirect the next week.
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.
It is a lot harder to implement it correctly than I thought, but it would be useful to implement this feature.
Current plans:
- [x] Ability to create ExpressJS app without running
- [x] 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