Jump to content

Recommended Posts

Hey friends,

I'm trying to run a video file from mms (microsoft media server) into a linux terminal , but I've got a syntax bash error.

How to escape parenthesis and maybe encoding empty spaces?

 

Example :

mplayer mms://vod.bgtelevizia.com/vod/onlineBTV-HQ/[bTV] 2012.11.18 -Sunday- (00-00).wmv

ERROR:
bash: syntax error near unexpected token `('

 

Example 2 works without any problems:

 


mplayer mms://v3.bgtelevizia.com/onlinebtv?token=4d377bcabbec99de204f68b5dbbba2fd

 

Thank you in advance!

Link to comment
https://forums.phpfreaks.com/topic/270844-bash-syntax-error/
Share on other sites

The spaces, dashes, and a few other characters, needs to be escaped as well. If the command is generated automatically by a script, use escapeshellarg () on the filename to prevent errors like these from happening.

Edited by Christian F.
Link to comment
https://forums.phpfreaks.com/topic/270844-bash-syntax-error/#findComment-1393308
Share on other sites

Christian, forget about php. This is only a bash script dumping the file from a mms remote server.

It's going to be something like this:

mplayer -dumpstream -dumpfile 2012.11.18 -Sunday- (00-00).wmv mms://vod.bgtelevizia.com/vod/onlineBTV-HQ/[bTV] 2012.11.18 -Sunday- (00-00).wmv

Link to comment
https://forums.phpfreaks.com/topic/270844-bash-syntax-error/#findComment-1393313
Share on other sites

Quoting the string gets rid of any bash errors for me, but I don't have mplayer installed, and I'm on OS X. Probably worth playing around with, though.

mplayer -dumpstream -dumpfile "2012.11.18 -Sunday- (00-00).wmv mms://vod.bgtelevizia.com/vod/onlineBTV-HQ/[bTV] 2012.11.18 -Sunday- (00-00).wmv"

Edited by Pikachu2000
Link to comment
https://forums.phpfreaks.com/topic/270844-bash-syntax-error/#findComment-1393315
Share on other sites

  • 1 month later...

Wow..... I've got it guys, linux is amazing and the people of that community, too :happy-04:

 

I needed to add that string to mplayer's config file.

 

For example:

 

vim ~/.mplayer/config

// add this
prefer-ipv4=yes

 

If you want it, you can try using my token to this particular streaming file, to check what's going on.

 

mplayer -dumpstream -dumpfile '2012.12.19 -Wednesday- (18-00).wmv' 'mms://67.159.54.219/vod/onlineBTV/[bTV] 2012.12.19 -Wednesday- (18-00).wmv?token=aea1884748fa97f6672c089db7eb92e0'

 

Now the question is, how to login via BASH to get the generating token to this particular account?

 

I'm thinking myself about CURL ?

Edited by jazzman1
Link to comment
https://forums.phpfreaks.com/topic/270844-bash-syntax-error/#findComment-1400524
Share on other sites

Hi guys, this thread is already solved!

 

If someone wants to see what's going on, please send me PM to provide her/him a real userName and password ( Christian, I was thinking about you :) )

 

Thanks for taking the time to help me about this.

 


#!/bin/bash

NAME='your Name'
PASS='your Password'
HIDDEN=`date '+%s'`
TIME=`date '+%Y%m%d'`

curl --cookie-jar cjar --output /dev/null 'http://www.djtacho.com/member/plugins/protect/new_rewrite/login.php?v=-any&url=/members/'

curl --cookie cjar --cookie-jar cjar --data 'amember_login='${NAME} --data 'amember_pass='${PASS} --data 'login_attempt_id='${HIDDEN} --location \
'http://www.djtacho.com/member/plugins/protect/new_rewrite/login.php?v=-any&url=/members/'

curl --verbose --cookie cjar --output ~/televizia.html 'http://www.djtacho.com/members/televizia.php'

grep -o 'mms://video.djtacho.com/onlineBTV\-hq?token=[a-zA-Z0-9]*' televizia.html > tvFile.txt

while read line; do
mplayer -dumpstream -dumpfile ${TIME}.wmv $line # or whaterver you want to do with the $line variable
sleep 300
done < tvFile.txt

Link to comment
https://forums.phpfreaks.com/topic/270844-bash-syntax-error/#findComment-1400966
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.