优酷视频mplayer自动连播脚本
- Ubuntu与Linux
- 帖子: 1211
- 注册时间: 2010-06-09 19:57
- 昊昊昊
- 帖子: 182
- 注册时间: 2011-08-22 21:22
Re: 优酷视频mplayer自动连播脚本
能帮我看看我的是神马情况吗?funicorn 写了:我的mplayer怎么不乱吗呢wykzly 写了:不错 就是mplayer标题乱码!
播放本地文件 shift + i 不乱码了,但是优酷视频还是乱码,

▓ 單 調 ▓
- 昊昊昊
- 帖子: 182
- 注册时间: 2011-08-22 21:22
Re: 优酷视频mplayer自动连播脚本
还有个问题,优酷上面的视频用mplayer播放都是分为N段,请看我的图,那电影是一个多小时,你们看时间!如果我已看到40多分钟,那该如何快进??
▓ 單 調 ▓
- 昊昊昊
- 帖子: 182
- 注册时间: 2011-08-22 21:22
-
- 帖子: 5
- 注册时间: 2010-05-13 17:44
Re: 优酷视频mplayer自动连播脚本
怎么使用这个脚本?我是UBUNTU 小白,是不是复制代码到空白的文本保存即可?另外,firefox 版本是6.0.2.ubuntu 10.10
-
- 帖子: 1318
- 注册时间: 2005-09-13 4:56
- 系统: Ubuntu Jammy Jellyfi
Re: 优酷视频mplayer自动连播脚本
mplayer中文标题乱码的问题是有补丁的,下载补丁之后,自己编译一个mplayer就行了。至于快进问题是无解的,脚本把多段文件当成播放列表处理,一个一个播放里面的流地址,mplayer只能在cache允许的范围内快进,所以快进的行为是mplayer控制的,脚本无能为力。如果你一定想要直接快进,只能先切换到播放列表中的下一个地址,然后快进。当然,换成smplayer播放的话,做这种事儿稍微方便点儿。昊昊昊 写了:还有个问题,优酷上面的视频用mplayer播放都是分为N段,请看我的图,那电影是一个多小时,你们看时间!如果我已看到40多分钟,那该如何快进??
即便你直接在浏览器中打开flash player窗口播放优酷的视频,你的浏览器也只能缓冲到当前这段文件结束的地方,当然使用flash player的好处是优酷的服务器会自动完成拼接,这样你可以用鼠标定位到后面某段的某个时间。
-
- 帖子: 5
- 注册时间: 2010-05-13 17:44
Re: 优酷视频mplayer自动连播脚本
终于可以了,原来要做脚本的属性里权限里勾选运行以程序运行,还有我改了代码的firefox为6.0.2.谢谢分享。我的mplay也是中文乱码。
- eexpress
- 帖子: 58428
- 注册时间: 2005-08-14 21:55
- 来自: 长沙
Re: 优酷视频mplayer自动连播脚本
viewtopic.php?f=21&t=274511昊昊昊 写了:能贴一份出来吗,研究研究!eexpress 写了:自动下载的,都发过,都没啥人用。
https://github.com/eexpress/eexp-bin/bl ... sh-down.pl
● 鸣学
-
- 帖子: 5
- 注册时间: 2010-05-13 17:44
Re: 优酷视频mplayer自动连播脚本
如何修改代码调用smplayer播放?是将代码的mplayer 修改为smplayer?
-
- 帖子: 5
- 注册时间: 2010-05-13 17:44
Re: 优酷视频mplayer自动连播脚本
已经可以调用smplayer播放了,但是标题好像显示的tmp/playlist............................. - smplayer,这个如何更改?谢谢!
- widon1104
- 帖子: 846
- 注册时间: 2008-07-17 10:55
Re: 优酷视频mplayer自动连播脚本
不错啊,用上了
如果能够解决超过7分钟视频快进问题就好了,折衷的解决也行。。。
如果能够解决超过7分钟视频快进问题就好了,折衷的解决也行。。。
- Ubuntu与Linux
- 帖子: 1211
- 注册时间: 2010-06-09 19:57
Re: 优酷视频mplayer自动连播脚本
代码: 全选
#!/bin/bash
UA="Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)"
wurl=$1
fmt=$2
parser="http://www.flvcd.com/parse.php?flag=&format=$fmt&kw=$wurl&sbt=%BF%AA%CA%BCGO%21"
wget $parser -q -U "$UA" -O /tmp/dump
iconv -f gbk -t utf-8 /tmp/dump -o /tmp/dump
get_m3u() {
line=`cat /tmp/dump |wc -l`
m3u_start=`grep "m3u" /tmp/dump -n`
start_line=${m3u_start%%:*}
m3u_end=`grep "M3U" /tmp/dump -n`
end_line=${m3u_end%%:*}
cut_line=$(($line-$end_line+2))
tac /tmp/dump |sed -e "1,$cut_line d" |tac >/tmp/url
sed -i "1,$start_line d" /tmp/url
sed -i '/1/s/<input type="hidden" name="inf" value="//g' /tmp/url
}
get_url() {
grep "<U>" /tmp/dump > /tmp/url
sed -i 's/<U>//g' /tmp/url
}
get_title() {
grep "<N>" /tmp/dump >/tmp/title
sed -i 's/<N>//g' /tmp/title
file="`sed -n '1p' /tmp/title` "
file=$(echo $file|sed 's/.....$//')
}
get_playlist() {
for ((i=1; i<=$u_length; ++i))
do
ttl=`sed -n "$i p" /tmp/title`
sed -i "$((2*i-1)) i #EXTINF:PART $i in $u_length, $ttl" /tmp/url
done
mv /tmp/url /tmp/play.m3u
sed -i "1i#EXTM3U" /tmp/play.m3u
}
download() {
mkdir -p /home/oooo/Videos/$file
if [ -s /tmp/play.m3u ]; then
cat /tmp/play.m3u|sed '/http/!d' > /tmp/playlist.title
rm /tmp/play.m3u
t=$(cat /tmp/playlist.title)
j=1
for i in $t
#notify-send "playing $file"
do
wget -U "$UA" $i -O /home/oooo/Videos/$file/$j.flv
j=$((j+1))
done
elif [ -s /tmp/url ]; then
cat /tmp/url|sed '/http/!d' >/tmp/playlist
rm /tmp/url
t=$(cat /tmp/playlist)
j=1
for i in $t
#notify-send "playing $file"
do
wget -U "$UA" $i -O /home/oooo/Videos/$file/$j.flv
j=$((j+1))
done
fi
}
if [ "`grep m3u /tmp/dump`" != "" ] ; then
get_m3u
else
get_url
fi
get_title
u_length=`cat /tmp/url |wc -l`
t_length=`cat /tmp/title |wc -l`
get_playlist
rm /tmp/title /tmp/dump
download
- acer4740
- 帖子: 1405
- 注册时间: 2010-09-13 19:04
- 来自: 0xFF00EE
-
- 帖子: 1318
- 注册时间: 2005-09-13 4:56
- 系统: Ubuntu Jammy Jellyfi
Re: 优酷视频mplayer自动连播脚本
折中的方案就是不要播放优酷的,试试土豆,乐视这种只有一段的视频,这个脚本播放优酷以外的网站,80%的时候有效,失效原因不明,似乎是不能获取正确的视频流地址,这是flvcd的问题,基本无解。
widon1104 写了:不错啊,用上了
如果能够解决超过7分钟视频快进问题就好了,折衷的解决也行。。。
- mjp123
- 帖子: 703
- 注册时间: 2009-04-09 15:06
Re: 优酷视频mplayer自动连播脚本
Shift + >funicorn 写了:昊昊昊 写了:还有个问题,优酷上面的视频用mplayer播放都是分为N段,请看我的图,那电影是一个多小时,你们看时间!如果我已看到40多分钟,那该如何快进??