9001 / 9001/copyparty

Copyparty breaks when using it as a Twitch proxy

Abierto
#349 0 comentarios 0 reacciones 1 asignado Reclamado por @9001 Ver en GitHub
bug
Lenguaje dominante
Python
Estrellas
46.6k
Forks
1.9k
Merge medio
10 d 16 h
PR fusionados (30 d)
5

Descripción

I was absolutely trying to abuse copyparty in a way it probably was not intended to be used. If you flag this as no-fix I understand completely LOL

### Describe the bug
Copyparty breaks when using it as a Twitch proxy via streamlink.

### To Reproduce
* Use `streamlink` to download a stream while it's live and store to a m3u8 file on the server
* e.g. `streamlink -o "E:\Share\Events\Test.m3u8" "https://www.twitch.tv/marimari_en" best`
* Browse to the file on copyparty in a browser without authenticating
* Click Play
* Copyparty shits the bed

### Expected behavior
The stream would play in the native browser using Copyparty as a proxy.

### Screenshots
In attempting this 4 times I got different errors each time. Note that streamlink was still downloading and modifying the file so these were not identical states.

One common occurrence is that for some of these attempts, the window would show some garbled search results before crashing out to the bug report screen.

#### Attempt 1
```
/.cpr/browser.js @3370:13
TypeError: can't access property "getAttribute", link is undefined

UA: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:141.0) Gecko/20100101 Firefox/141.0

stack:
MPlayer@/.cpr/browser.js:3370:13
reload_mp@/.cpr/browser.js:10970:7
reload_browser@/.cpr/browser.js:11015:2
r.render@/.cpr/browser.js:8121:3
render_m3u@/.cpr/browser.js:8231:12

11: au_eq_amp 0 au_eq_chw 1 au_eq_gain [4,3,2,1,0,0,1,2,3,4] au_open 1 cpp_keynot rekobo_alnum entreed tree filecols ["vq","aq","Vc","Ac","Fmt","Res","fps"] have_webp ya hfilecols [".vq",".aq","vc","ac","fmt","res",".fps"] light 0 opmode mkdir

console:

1753918710527 @
1753918702297 log: sha-ok
1753918702274 log: h-repl /events/
1753918702259 log: log-capture ok
```

#### Attempt 2

```
/.cpr/browser.js @3370:13
TypeError: can't access property "getAttribute", link is undefined

UA: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:141.0) Gecko/20100101 Firefox/141.0

stack:
MPlayer@/.cpr/browser.js:3370:13
reload_mp@/.cpr/browser.js:10970:7
reload_browser@/.cpr/browser.js:11015:2
r.render@/.cpr/browser.js:8121:3
render_m3u@/.cpr/browser.js:8231:12

10: au_eq_amp 0 au_eq_chw 1 au_eq_gain [4,3,2,1,0,0,1,2,3,4] au_open 1 cpp_keynot rekobo_alnum filecols ["vq","aq","Vc","Ac","Fmt","Res","fps"] have_webp ya hfilecols [".vq",".aq","vc","ac","fmt","res",".fps"] light 0 opmode mkdir

console:

1753917942449 @
1753917932777 log: h-repl /events/#
1753917928764 log: main thread blocked for 7478
1753917921286 log: main thread blocked for 17122
1753917913446 log: h-repl /events/#m3u=Test.m3u8
1753917890067 log: sha-ok
1753917890015 log: h-repl /events/
1753917889994 log: log-capture ok

```

#### Attempt 3
```
you hit a bug!

try to [reset copyparty settings](https://192.168.1.69:3923/events/#) if you are stuck here, or [ignore this](https://192.168.1.69:3923/events/#) / [ignore all](https://192.168.1.69:3923/events/#) / [basic](https://192.168.1.69:3923/events/?b=u)

please send me a screenshot arigathanks gozaimuch: [new github issue](https://github.com/9001/copyparty/issues/new?labels=bug&template=bug_report.md)

/.cpr/browser.js @3370:13
TypeError: can't access property "getAttribute", link is undefined

UA: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:141.0) Gecko/20100101 Firefox/141.0

stack:
MPlayer@/.cpr/browser.js:3370:13
reload_mp@/.cpr/browser.js:10970:7
reload_browser@/.cpr/browser.js:11015:2
r.render@/.cpr/browser.js:8121:3
render_m3u@/.cpr/browser.js:8231:12

11: au_eq_amp 0 au_eq_chw 1 au_eq_gain [4,3,2,1,0,0,1,2,3,4] au_open 1 cpp_keynot rekobo_alnum entreed tree filecols ["vq","aq","Vc","Ac","Fmt","Res","fps"] have_webp ya hfilecols [".vq",".aq","vc","ac","fmt","res",".fps"] light 0 opmode mkdir

console:

1753918747098 @
1753918738362 log: sha-ok
1753918738336 log: h-repl /events/
1753918738322 log: log-capture ok
```

#### Attempt 4 - Chrome Edition
```
/.cpr/browser.js @8116:32
Uncaught RangeError: Invalid string length

UA: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36
UAD: Chromium/138, Google Chrome/138, Windows

stack:
RangeError: Invalid string length
at Array.join ()
at r.render (/.cpr/browser.js:8116:32)
at XMLHttpRequest.render_m3u (/.cpr/browser.js:8231:12)

9: au_eq_amp 0 au_eq_chw 1 au_eq_gain [4,3,2,1,0,0,1,2,3,4] au_open 0 cpp_keynot rekobo_alnum filecols ["vq","aq","Vc","Ac","Fmt","Res","fps"] have_webp ya hfilecols [".vq",".aq","vc","ac","fmt","res",".fps"] light 0

console:

1753919061660 @
1753919037799 log: sha-ok
1753919037722 log: applying default hidden-cols
1753919037722 log: h-repl /events/
1753919037673 log: log-capture ok
```

### Server details (if you're NOT using docker/podman)
remove the ones that are not relevant:
* **server OS / version:** Windows
* **what copyparty did you grab:** exe
* **Version:** 1.18.7.0
* **how you're running it:** Running in Windows Terminal
* run copyparty with `--version` and grab the last 3 lines (they start with `copyparty`, `CPython`, `sqlite`) and paste them below this line:
```
copyparty v1.18.7 "logtail" (2025-07-30)
CPython v3.13.5 on Windows64 10.0.19045 [MSC v.1943 64 bit (AMD64)]
sqlite 3.49.1*1 | jinja 3.1.6 | pyftpd 1.5.10 | tftp 0.4.0
```

* **copyparty arguments and/or config-file:**
```
[global]
lo: E:/Share/Scripts/Copyparty/logs/cpp-%Y-%m-%d.log
e2dsa, e2ts, z, dedup, no-vthumb, no-robots, force-js, https-only
# p: 443 # listen on ports 80 and 443, not 3923
theme: 2 # default theme: protonmail-monokai
lang: eng # default language: viking

[accounts] # usernames and passwords
fullest:[redacted]

[/events] # create another volume at /events
E:\Share\Events # sharing this filesystem location
accs: # permissions:
r: * # everyone can browse
rwmd: fullest # fullest is admin
```

### Client details
if the issue is possibly on the client-side, then mention some of the following:
* the device type and model: Custom PC build
* OS version: Windows 10 22H2
* browser version: Firefox 141.0 and Chrome 138.0.7204.102

Notably, when watching the video with VLC's network stream functionality, it works pretty good. In that scenario it just has an issue of stopping playback when it reaches the end of file instead of buffering.

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.