Jump to content

Bash: Syntax Error


jazzman1

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

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"

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 ?

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.