Active Topics

 


Reply
Thread Tools
Addison's Avatar
Posts: 3,811 | Thanked: 1,151 times | Joined on Oct 2007 @ East Lansing, MI
#61
What about moving the mouse and then send something like a right arrow key so that the cursor is then in the URL address bar?
 
Addison's Avatar
Posts: 3,811 | Thanked: 1,151 times | Joined on Oct 2007 @ East Lansing, MI
#62
Say I would like to resume something 90 minutes into a video...

Right now, I have to hold the fast forward button for like 15 minutes to get there.

In Linux, is it possible to delete part of a file?

Like cut out the first 200 megs so when I play the file, it will start very close to where I would like to resume watching it?
 
Posts: 875 | Thanked: 918 times | Joined on Sep 2010
#63
Originally Posted by Addison View Post
Say I would like to resume something 90 minutes into a video...
The "-ss HH:MM:SS" option seeks to a point in the video. Hopefully the tablet version of mplayer supports it.

Code:
mplayer my-video.mp4 -ss 0:90
 

The Following User Says Thank You to auouymous For This Useful Post:
Addison's Avatar
Posts: 3,811 | Thanked: 1,151 times | Joined on Oct 2007 @ East Lansing, MI
#64
Thanks!

I'll give it a try.
 
Addison's Avatar
Posts: 3,811 | Thanked: 1,151 times | Joined on Oct 2007 @ East Lansing, MI
#65
mplayer my-video.mp4 -ss 0:90
Okay. This only works for .mp4 and .avi files.

I guess .flv can't use this feature.
 
Addison's Avatar
Posts: 3,811 | Thanked: 1,151 times | Joined on Oct 2007 @ East Lansing, MI
#66
Is there something else running besides mplayer and this script in the background?

When I run yt clean I sometimes get weirdness afterwards.

There will be times when the next video won't begin to play automatically, or it might play super chunky.

Sometimes it will play the video twice at the same time.

Even times when I close the video, it will keep popping back up trying to play itself over and over again.

Just curious, that's all.
 
Posts: 875 | Thanked: 918 times | Joined on Sep 2010
#67
Originally Posted by Addison View Post
Is there something else running besides mplayer and this script in the background?
yt, youtube-dl-x and mplayer should be the only programs running, besides anything you may have running.


Originally Posted by Addison View Post
When I run yt clean I sometimes get weirdness afterwards.
`yt clean` kills mplayer, kills the previous instance of itself, kills youtube-dl-x and removes the downloaded videos. Nothing weird can happen.


Originally Posted by Addison View Post
There will be times when the next video won't begin to play automatically, or it might play super chunky.
Next video? I don't recall yt having the ability to queue up videos.


Originally Posted by Addison View Post
Sometimes it will play the video twice at the same time. Even times when I close the video, it will keep popping back up trying to play itself over and over again.
The original script has nothing that would play the video twice simultaneouly, nor does it have any way to restart mplayer.

What modifications have you made to the script?
 

The Following User Says Thank You to auouymous For This Useful Post:
Addison's Avatar
Posts: 3,811 | Thanked: 1,151 times | Joined on Oct 2007 @ East Lansing, MI
#68
This is my download script.

Code:
#!/bin/sh

# version 1.3

# set this to the directory where videos will be downloaded
VIDEO_DOWNLOAD_DIR="/media/mmc1/Videos"
VIDEO_SAVE_DIR="/media/mmc1/Favorites"

# REQUIRED:
# /usr/bin/youtube-dl-x -- http://rg3.github.com/youtube-dl/
# xclip -- http://asui.garage.maemo.org/_download/xclip
# apt-get install libxmu6

# USAGE:
# yt [URL]      -- download and play video in clipboard
# yt get [URL]  -- download video in clipboard
# yt kill       -- kill all downloads and playback
# yt clean      -- remove all downloaded videos
# yt save [URL] -- move already downloaded video in clipboard to saved video directory

#################################
matchbox-remote -next
xte 'keydown Up' 'keyup Up' 'keydown Escape' 'keyup Escape'

if [ "$1" = "get" -o "$1" = "kill" -o "$1" = "clean" -o "$1" = "save" ]; then
	VIDEO=$2
else
	VIDEO=$1
fi
[ "$VIDEO" = "" ] && VIDEO=`xclip -out`
[ "$VIDEO" = "" -a "$1" != "kill" -a "$1" != "clean" ] && echo "Copy a youtube URL to clipboard or specify one on the command line" && exit

if [ "$1" = "kill" ]; then
	killall mplayer
	kill `ps aux|grep "/bin/sh $0"|grep -vE "(grep|kill|clean)"|awk '{print $1}'`
	kill `ps aux|grep "python /usr/bin/youtube-dl-x"|grep -v grep|awk '{print $1}'`
elif [ "$1" = "get" ]; then
	cd "$VIDEO_DOWNLOAD_DIR"
	echo "Downloading $VIDEO..."
	/usr/bin/youtube-dl-x --no-part -f 5 -o "%(stitle)s.%(ext)s" "$VIDEO"
elif [ "$1" = "save" ]; then
	cd "$VIDEO_DOWNLOAD_DIR"
	echo "Saving $VIDEO..."
	FILE=`youtube-dl-x --no-part -c -f 5 -o "%(stitle)s.%(ext)s" --get-filename "$VIDEO"`
	mv "$FILE" "$VIDEO_SAVE_DIR"/
elif [ "$1" = "clean" ]; then
	$0 kill
	rm -f "$VIDEO_DOWNLOAD_DIR"/*
else
	cd "$VIDEO_DOWNLOAD_DIR"
	echo "Downloading $VIDEO..."
	youtube-dl-x --no-part -c -f 5 -o "%(stitle)s.%(ext)s" "$VIDEO" &
	FILE=`youtube-dl-x --no-part -f 5 -o "%(stitle)s.%(ext)s" --get-filename "$VIDEO"`
	while [ ! -f "$FILE" ]; do sleep 5 ; done
	while [ "`/bin/ls -s "$FILE"|awk '{print $1}'`" -lt "4" ]; do sleep 5 ; done
	sleep 30
	mplayer "$FILE"
fi
And this is my clean up script.

Code:
#!/bin/sh

# version 1.3

# set this to the directory where videos will be downloaded
VIDEO_DOWNLOAD_DIR="/media/mmc1/Videos"
VIDEO_SAVE_DIR="/media/mmc1/Favorites"

# REQUIRED:
# /usr/bin/youtube-dl-x -- http://rg3.github.com/youtube-dl/
# xclip -- http://asui.garage.maemo.org/_download/xclip
# apt-get install libxmu6

# USAGE:
# yt [URL]      -- download and play video in clipboard
# yt get [URL]  -- download video in clipboard
# yt kill       -- kill all downloads and playback
# yt clean      -- remove all downloaded videos
# yt save [URL] -- move already downloaded video in clipboard to saved video directory

#################################

if [ "$1" = "get" -o "$1" = "kill" -o "$1" = "clean" -o "$1" = "save" ]; then
	VIDEO=$2
else
	VIDEO=$1
fi
[ "$VIDEO" = "" ] && VIDEO=`xclip -out`
[ "$VIDEO" = "" -a "$1" != "kill" -a "$1" != "clean" ] && echo "Copy a youtube URL to clipboard or specify one on the command line" && exit

if [ "$1" = "kill" ]; then
	killall mplayer
	matchbox-remote -next
	kill `ps aux|grep "/bin/sh $0"|grep -vE "(grep|kill|clean)"|awk '{print $1}'`
	kill `ps aux|grep "python /usr/bin/youtube-dl-x"|grep -v grep|awk '{print $1}'`
elif [ "$1" = "get" ]; then
	cd "$VIDEO_DOWNLOAD_DIR"
	echo "Downloading $VIDEO..."
	/usr/bin/youtube-dl-x --no-part -f 5 -o "%(stitle)s.%(ext)s" "$VIDEO"
elif [ "$1" = "save" ]; then
	cd "$VIDEO_DOWNLOAD_DIR"
	echo "Saving $VIDEO..."
	FILE=`youtube-dl-x --no-part -c -f 5 -o "%(stitle)s.%(ext)s" --get-filename "$VIDEO"`
	mv "$FILE" "$VIDEO_SAVE_DIR"/
elif [ "$1" = "clean" ]; then
	$0 kill
	rm -f "$VIDEO_DOWNLOAD_DIR"/*
else
	cd "$VIDEO_DOWNLOAD_DIR"
	echo "Downloading $VIDEO..."
	youtube-dl-x --no-part -c -f 5 -o "%(stitle)s.%(ext)s" "$VIDEO" &
	FILE=`youtube-dl-x --no-part -f 5 -o "%(stitle)s.%(ext)s" --get-filename "$VIDEO"`
	while [ ! -f "$FILE" ]; do sleep 5 ; done
	while [ "`/bin/ls -s "$FILE"|awk '{print $1}'`" -lt "4" ]; do sleep 5 ; done
	sleep 30
	mplayer "$FILE"
fi
The weirdness I mentioned usually happens on the next video download after I run the yt clean script or when a video didn't download at all for some odd reason.

For me, it's almost as though there's some extra process running in mplayer if that makes any sense.
 
Posts: 875 | Thanked: 918 times | Joined on Sep 2010
#69
Originally Posted by Addison View Post
This is my download script.

The weirdness I mentioned usually happens on the next video download after I run the yt clean script or when a video didn't download at all for some odd reason.

For me, it's almost as though there's some extra process running in mplayer if that makes any sense.
Looks like the only changes you have are the three matchbox/xte lines. The biggest problem I see is that you have two separate scripts. The kill and clean commands require the scripts to have the same name, which isn't possible with two scripts.

Get rid of the clean up script and move the matchbox line from the kill section to the download script. Wrap the two matchbox/xte lines with the following so they won't be executed when using kill or clean.

Code:
if [ "$1" != "kill" -a "$1" != "clean" ]; then
  matchbox-remote -next
  xte 'keydown Up' 'keyup Up' 'keydown Escape' 'keyup Escape'
fi
 

The Following User Says Thank You to auouymous For This Useful Post:
Addison's Avatar
Posts: 3,811 | Thanked: 1,151 times | Joined on Oct 2007 @ East Lansing, MI
#70
Okay. Thank you very much.

I wasn't exactly sure where to place those extra commands so I ended up with two scripts instead.

Cheers buddy.
 
Reply


 
Forum Jump


All times are GMT. The time now is 12:31.