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

Error launching particular stream #362

Closed
oakenhold opened this issue Dec 10, 2016 · 19 comments
Closed

Error launching particular stream #362

oakenhold opened this issue Dec 10, 2016 · 19 comments

Comments

@oakenhold
Copy link

oakenhold commented Dec 10, 2016

Encountered an error launching a particular stream, does not occur for other streams that I've tried. Error message is "The process exited with code 1".

To add on, I have no issues launching the same stream via CLI (Twitch OAuth token enabled).

Windows 7 Pro
streamlink-script.py 0.1.0
Streamlink Twitch GUI 1.0.0 64bit

Error message for https://www.twitch.tv/wow_tomato:

Traceback (most recent call last):
File "D:\Program Files (x86)\Streamlink\bin\streamlink-script.py", line 12, in <module>
main()
File "D:\Program Files (x86)\Streamlink\pkgs\streamlink_cli\main.py", line 899, in main
handle_url()
File "D:\Program Files (x86)\Streamlink\pkgs\streamlink_cli\main.py", line 499, in handle_url
handle_stream(plugin, streams, stream_name)
File "D:\Program Files (x86)\Streamlink\pkgs\streamlink_cli\main.py", line 378, in handle_stream
return output_stream_http(plugin, streams)
File "D:\Program Files (x86)\Streamlink\pkgs\streamlink_cli\main.py", line 143, in output_stream_http
player.open()
File "D:\Program Files (x86)\Streamlink\pkgs\streamlink_cli\output.py", line 21, in open
self._open()
File "D:\Program Files (x86)\Streamlink\pkgs\streamlink_cli\output.py", line 123, in _open
self._open_subprocess()
File "D:\Program Files (x86)\Streamlink\pkgs\streamlink_cli\output.py", line 138, in _open_subprocess
self.player = subprocess.Popen(self._create_arguments(),
File "D:\Program Files (x86)\Streamlink\pkgs\streamlink_cli\output.py", line 116, in _create_arguments
return shlex.split(cmd) + shlex.split(args)
File "shlex.py", line 273, in split
File "shlex.py", line 263, in __next__
File "shlex.py", line 90, in get_token
File "shlex.py", line 166, in read_token
ValueError: No closing quotation

Error message for https://www.twitch.tv/zxc93824:

Traceback (most recent call last):
File "D:\Program Files (x86)\Streamlink\bin\streamlink-script.py", line 12, in <module>
main()
File "D:\Program Files (x86)\Streamlink\pkgs\streamlink_cli\main.py", line 899, in main
handle_url()
File "D:\Program Files (x86)\Streamlink\pkgs\streamlink_cli\main.py", line 499, in handle_url
handle_stream(plugin, streams, stream_name)
File "D:\Program Files (x86)\Streamlink\pkgs\streamlink_cli\main.py", line 378, in handle_stream
return output_stream_http(plugin, streams)
File "D:\Program Files (x86)\Streamlink\pkgs\streamlink_cli\main.py", line 143, in output_stream_http
player.open()
File "D:\Program Files (x86)\Streamlink\pkgs\streamlink_cli\output.py", line 21, in open
self._open()
File "D:\Program Files (x86)\Streamlink\pkgs\streamlink_cli\output.py", line 123, in _open
self._open_subprocess()
File "D:\Program Files (x86)\Streamlink\pkgs\streamlink_cli\output.py", line 138, in _open_subprocess
self.player = subprocess.Popen(self._create_arguments(),
File "D:\Program Files (x86)\Streamlink\pkgs\streamlink_cli\output.py", line 108, in _create_arguments
args = self.args.format(filename=filename)
KeyError: '�w���I�q'
@bastimeyer
Copy link
Member

This has already been fixed by 412ca46.
You can either build the application off the master branch or disable custom player window titles. I'll publish a new release with this bugfix in a few days.

@oakenhold oakenhold reopened this Dec 14, 2016
@oakenhold
Copy link
Author

I've updated to v1.0.1 but the error with the custom title still persists.

Traceback (most recent call last):
File "D:\Program Files (x86)\Streamlink\bin\streamlink-script.py", line 12, in <module>
main()
File "D:\Program Files (x86)\Streamlink\pkgs\streamlink_cli\main.py", line 899, in main
handle_url()
File "D:\Program Files (x86)\Streamlink\pkgs\streamlink_cli\main.py", line 499, in handle_url
handle_stream(plugin, streams, stream_name)
File "D:\Program Files (x86)\Streamlink\pkgs\streamlink_cli\main.py", line 378, in handle_stream
return output_stream_http(plugin, streams)
File "D:\Program Files (x86)\Streamlink\pkgs\streamlink_cli\main.py", line 143, in output_stream_http
player.open()
File "D:\Program Files (x86)\Streamlink\pkgs\streamlink_cli\output.py", line 21, in open
self._open()
File "D:\Program Files (x86)\Streamlink\pkgs\streamlink_cli\output.py", line 123, in _open
self._open_subprocess()
File "D:\Program Files (x86)\Streamlink\pkgs\streamlink_cli\output.py", line 138, in _open_subprocess
self.player = subprocess.Popen(self._create_arguments(),
File "D:\Program Files (x86)\Streamlink\pkgs\streamlink_cli\output.py", line 116, in _create_arguments
return shlex.split(cmd) + shlex.split(args)
File "shlex.py", line 273, in split
File "shlex.py", line 263, in __next__
File "shlex.py", line 90, in get_token
File "shlex.py", line 166, in read_token
ValueError: No closing quotation

@bastimeyer
Copy link
Member

Which channel are you trying to watch and which player config are you using?

ValueError: No closing quotation

This looks like a different error

@oakenhold
Copy link
Author

Channel: https://www.twitch.tv/wow_tomato
VLC player preset using VLC 2.2.4 64bit

@bastimeyer
Copy link
Member

I don't have any issues when using the custom window title option without using custom params.
Have you set custom player parameters in the VLC preset? The "no closing quotation" error message implies this.

@oakenhold
Copy link
Author

Custom parameters is blank. Is there a way to view the values that is causing the error?

@bastimeyer
Copy link
Member

Not from within the GUI in a production build.
You can try getting the command line from the Windows task manager, but this will look a bit different.

@bastimeyer
Copy link
Member

Okay, so it looks like Windows 7 is having some issues with certain unicode characters.
I don't know if this is related to python or not.

@oakenhold
Copy link
Author

I'm using Python 2.7. I've also tried launching with livestreamer and encountered the following error.

Traceback (most recent call last):
File "<string>", line 6, in <module>
File "__main__.py", line 128, in <module>
File "__main__livestreamer__.py", line 9, in <module>
File "livestreamer_cli\main.py", line 886, in main
File "livestreamer_cli\main.py", line 491, in handle_url
File "livestreamer_cli\main.py", line 374, in handle_stream
File "livestreamer_cli\main.py", line 141, in output_stream_http
File "livestreamer_cli\output.py", line 21, in open
File "livestreamer_cli\output.py", line 123, in _open
File "livestreamer_cli\output.py", line 138, in _open_subprocess
File "livestreamer_cli\output.py", line 108, in _create_arguments
ValueError: Single '}' encountered in format string

@bastimeyer
Copy link
Member

This is the generated parameter list:

[
  "C:\\Program Files (x86)\\Streamlink\\bin\\streamlink-script.py",
  "--http-header",
  "Client-ID=phiay4sq36lfv9zu7cbqwz2ndnesfd8",
  "--no-version-check",
  "--twitch-disable-hosting",
  "--player",
  "C:\\Program Files (x86)\\VideoLAN\\VLC\\vlc.exe",
  "--player-args",
  "--no-one-instance --play-and-exit --input-title-format \"哇頭沒頭 - Creative - #Drawing #Postcard【哇頭沒頭\\\"慢步調】上班好睡眠│手繪明信片開獎啦\" {filename}",
  "--player-passthrough",
  "rtmp",
  "--hls-live-edge",
  "3",
  "--hls-segment-threads",
  "1",
  "--retry-open",
  "1",
  "--retry-streams",
  "1"
]

As you can see, the GUI correctly escapes the " character in the stream title.
For some reason, the parser Streamlink is using on Windows doesn't recognize this.

@oakenhold
Copy link
Author

Is it required to escape the pipe?

@bastimeyer
Copy link
Member

Yes it, is.
It's a parsing issue of Streamlink on Windows. I think this is related to #256...

To reproduce this, run this:
streamlink -p /path/to/vlc -a "--meta-title \"\\\"\" {filename}" twitch.tv/CHANNEL best

This will work correctly on Linux, but fails on Windows.

@oakenhold
Copy link
Author

Yup, it fails when I run it in command prompt. Will you be raising this in streamlink or should I raise this issue there?

@bastimeyer
Copy link
Member

I'll create an issue in a sec. I was just testing this on other Windows versions...

@bastimeyer
Copy link
Member

The bug has been fixed in streamlink/streamlink#300.
There will be a new Streamlink release soon which includes this bugfix. You can also try installing Streamlink for the HEAD of the git repository.

I'll set the minimum required version of Streamlink to 0.2.0 when this gets released, so that this bug doesn't occur anymore while using the Twitch GUI.

@bastimeyer
Copy link
Member

I'll set the minimum required version of Streamlink to 0.2.0

Done in e2662aa...

The Streamlink 0.2.0 Windows installer has some issues right now and is reporting a wrong version.
People who have built the app off the master branch need to use the Streamlink nightlies until this gets resolved.

@neffers
Copy link

neffers commented Jan 4, 2017

I am still having this same issue on Ubuntu with the latest release and streamlink 0.2.0. When a stream title has a single (haven't thoroughly tested double) quote in it (and it's set to put the stream title in the window title), the stream fails to launch. Exit code 1, ValueError: No closing quotation.

EDIT: It should be noted that using double quotes in the player parameters fixes this. However it still occurs when using single quotes, eg: --title='{name} : {title}' will fail, while --title="{name} : {title}" will not

@bastimeyer
Copy link
Member

Yep, Streamlink still doesn't parse this correctly:

streamlink -p mpv -a "--title '\'' {filename}" twitch.tv/CHANNEL best

This works:

streamlink -p mpv -a "--title \"\\\"\" {filename}" twitch.tv/CHANNEL best

@bastimeyer
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants