reduzent/watchteleboy

not starting subprocess (mplayer, rtmpdump, ...?)

thonixx opened this issue · 5 comments

I just tried to start watchteleboy with "SRF1" as channel but mplayer does not start.
These are the started processes (even after waiting for over a minute):

user     19885  0.0  0.1  63312 14844 pts/6    Ss   Feb07   0:13          |   \_ /bin/zsh
user     12365  0.6  0.0  24204  3820 pts/6    S+   11:59   0:00          |   |   \_ /bin/bash -i ./watchteleboy -c SRF1
user     14793  0.0  0.0   8712   628 pts/6    S+   12:00   0:00          |   |       \_ sleep 0.1

Additional comment:

After interrupting with CTRL-C:

du: cannot access ‘/tmp/watchteleboy.thonixx/stream.flv’: No such file or directory
bash: * 1024 : syntax error: operand expected (error token is "* 1024 ")

Stacktrace tells me that the script tries to start a process in an infinite loop.

--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=32493, si_status=0, si_utime=0, si_stime=0} ---
wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], WNOHANG, NULL) = 32493
wait4(-1, 0x7fff21c50e58, WNOHANG, NULL) = -1 ECHILD (No child processes)
rt_sigreturn()                          = 0
close(3)                                = 0
rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0
rt_sigaction(SIGINT, {0x43f800, [], SA_RESTORER, 0x7f12e2a4aff0}, {0x458450, [], SA_RESTORER, 0x7f12e2a4aff0}, 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
rt_sigaction(SIGINT, {0x458450, [], SA_RESTORER, 0x7f12e2a4aff0}, {0x43f800, [], SA_RESTORER, 0x7f12e2a4aff0}, 8) = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
rt_sigprocmask(SIG_BLOCK, [INT CHLD], [], 8) = 0
rt_sigprocmask(SIG_BLOCK, [CHLD], [INT CHLD], 8) = 0
rt_sigprocmask(SIG_SETMASK, [INT CHLD], NULL, 8) = 0
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f12e33fca10) = 32496
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0
rt_sigaction(SIGINT, {0x43f800, [], SA_RESTORER, 0x7f12e2a4aff0}, {0x458450, [], SA_RESTORER, 0x7f12e2a4aff0}, 8) = 0
wait4(-1, 

Hi thonixx

Thanks for your bug report. Indeed, it seems your script is hanging at line 877 where it waits indefinitely for the streaming file to grow. Somehow rtmpdump doesn't seem to receive a stream which is why the streaming file does not grow.

Can you test your teleboy login in the browser? Login to their web page and try to watch a stream. After successfully having watched a channel on their web page, try again with watchteleboy. Sometimes they want their users to check some checkboxes (for confirming your age or similar), which might be a reason for not receiving streams.

Unfortunately, watchteleboy is only able to check validity of the credentials, but it cannot (yet) detect other reasons for not receiving streams.

If that really was the reason, please let me know, what checkbox you had to check (or in what way you could make it work). It might help me improve the script.

Roman

I have analysed it and I had to agree to the TOS.

See:
screenshot

Maybe the script could check for that in any way.
Alternatively you could - after some seconds without stream - display a link to the channel with the hint to maybe click on something.

Link could be like this: http://www.teleboy.ch/tv/player/player.php?stationId=$ID

Thanks for your report.

The script is a bit too 'dumb' now, as it doesn't really check the exit code of rtmpdump. It just launches it into the background and doesn't check further and expects it to run until it is actively stopped. Of course, if rtmpdump exits prematurely, this is not yet detected by the script.

I'll figure out a better design where the rtmpdump is actively monitored and it's exit code checked.

Thanks for your suggestions.

I don't recall the exact commit, but the scripts now checks the return code of rtmpdump