优酷视频mplayer自动连播脚本

上网、浏览、聊天、下载等
回复
头像
Ubuntu与Linux
帖子: 1211
注册时间: 2010-06-09 19:57

Re: 优酷视频mplayer自动连播脚本

#16

帖子 Ubuntu与Linux » 2011-09-13 22:44

经测试,是mplayer自己对中文名称乱码。
可以google解法。但是不如就去掉名称也行
头像
昊昊昊
帖子: 182
注册时间: 2011-08-22 21:22

Re: 优酷视频mplayer自动连播脚本

#17

帖子 昊昊昊 » 2011-09-14 10:34

funicorn 写了:
wykzly 写了:不错 就是mplayer标题乱码!
我的mplayer怎么不乱吗呢
附件 screenshot.png 已经无效
能帮我看看我的是神马情况吗?
播放本地文件 shift + i 不乱码了,但是优酷视频还是乱码, :em06
附件
screenshot80.png
▓   單 調   ▓
头像
昊昊昊
帖子: 182
注册时间: 2011-08-22 21:22

Re: 优酷视频mplayer自动连播脚本

#18

帖子 昊昊昊 » 2011-09-14 10:59

还有个问题,优酷上面的视频用mplayer播放都是分为N段,请看我的图,那电影是一个多小时,你们看时间!如果我已看到40多分钟,那该如何快进??
附件
screenshot84.png
▓   單 調   ▓
头像
昊昊昊
帖子: 182
注册时间: 2011-08-22 21:22

Re: 优酷视频mplayer自动连播脚本

#19

帖子 昊昊昊 » 2011-09-14 11:14

eexpress 写了:自动下载的,都发过,都没啥人用。
能贴一份出来吗,研究研究! :em01
▓   單 調   ▓
leoliu986616
帖子: 5
注册时间: 2010-05-13 17:44

Re: 优酷视频mplayer自动连播脚本

#20

帖子 leoliu986616 » 2011-09-15 20:38

怎么使用这个脚本?我是UBUNTU 小白,是不是复制代码到空白的文本保存即可?另外,firefox 版本是6.0.2.ubuntu 10.10
funicorn
帖子: 1318
注册时间: 2005-09-13 4:56
系统: Ubuntu Jammy Jellyfi

Re: 优酷视频mplayer自动连播脚本

#21

帖子 funicorn » 2011-09-15 21:04

昊昊昊 写了:还有个问题,优酷上面的视频用mplayer播放都是分为N段,请看我的图,那电影是一个多小时,你们看时间!如果我已看到40多分钟,那该如何快进??
mplayer中文标题乱码的问题是有补丁的,下载补丁之后,自己编译一个mplayer就行了。至于快进问题是无解的,脚本把多段文件当成播放列表处理,一个一个播放里面的流地址,mplayer只能在cache允许的范围内快进,所以快进的行为是mplayer控制的,脚本无能为力。如果你一定想要直接快进,只能先切换到播放列表中的下一个地址,然后快进。当然,换成smplayer播放的话,做这种事儿稍微方便点儿。

即便你直接在浏览器中打开flash player窗口播放优酷的视频,你的浏览器也只能缓冲到当前这段文件结束的地方,当然使用flash player的好处是优酷的服务器会自动完成拼接,这样你可以用鼠标定位到后面某段的某个时间。
leoliu986616
帖子: 5
注册时间: 2010-05-13 17:44

Re: 优酷视频mplayer自动连播脚本

#22

帖子 leoliu986616 » 2011-09-15 21:04

终于可以了,原来要做脚本的属性里权限里勾选运行以程序运行,还有我改了代码的firefox为6.0.2.谢谢分享。我的mplay也是中文乱码。
头像
eexpress
帖子: 58428
注册时间: 2005-08-14 21:55
来自: 长沙

Re: 优酷视频mplayer自动连播脚本

#23

帖子 eexpress » 2011-09-15 21:10

昊昊昊 写了:
eexpress 写了:自动下载的,都发过,都没啥人用。
能贴一份出来吗,研究研究! :em01
viewtopic.php?f=21&t=274511
https://github.com/eexpress/eexp-bin/bl ... sh-down.pl
● 鸣学
leoliu986616
帖子: 5
注册时间: 2010-05-13 17:44

Re: 优酷视频mplayer自动连播脚本

#24

帖子 leoliu986616 » 2011-09-15 21:11

如何修改代码调用smplayer播放?是将代码的mplayer 修改为smplayer?
leoliu986616
帖子: 5
注册时间: 2010-05-13 17:44

Re: 优酷视频mplayer自动连播脚本

#25

帖子 leoliu986616 » 2011-09-15 21:19

已经可以调用smplayer播放了,但是标题好像显示的tmp/playlist............................. - smplayer,这个如何更改?谢谢!
头像
widon1104
帖子: 846
注册时间: 2008-07-17 10:55

Re: 优酷视频mplayer自动连播脚本

#26

帖子 widon1104 » 2011-09-22 23:57

不错啊,用上了
如果能够解决超过7分钟视频快进问题就好了,折衷的解决也行。。。
头像
Ubuntu与Linux
帖子: 1211
注册时间: 2010-06-09 19:57

Re: 优酷视频mplayer自动连播脚本

#27

帖子 Ubuntu与Linux » 2011-09-23 12:13

代码: 全选

#!/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

Re: 优酷视频mplayer自动连播脚本

#28

帖子 acer4740 » 2011-09-23 13:56

同样的代理,flash上很快,弄到播放器上就卡的厉害,不知道死优酷怎么弄的
funicorn
帖子: 1318
注册时间: 2005-09-13 4:56
系统: Ubuntu Jammy Jellyfi

Re: 优酷视频mplayer自动连播脚本

#29

帖子 funicorn » 2011-09-23 14:17

折中的方案就是不要播放优酷的,试试土豆,乐视这种只有一段的视频,这个脚本播放优酷以外的网站,80%的时候有效,失效原因不明,似乎是不能获取正确的视频流地址,这是flvcd的问题,基本无解。
widon1104 写了:不错啊,用上了
如果能够解决超过7分钟视频快进问题就好了,折衷的解决也行。。。
头像
mjp123
帖子: 703
注册时间: 2009-04-09 15:06

Re: 优酷视频mplayer自动连播脚本

#30

帖子 mjp123 » 2011-09-23 15:13

funicorn 写了:
昊昊昊 写了:还有个问题,优酷上面的视频用mplayer播放都是分为N段,请看我的图,那电影是一个多小时,你们看时间!如果我已看到40多分钟,那该如何快进??
Shift + >
回复