Re: [elinks-users] youtube.com in ELinks?

2009-01-03 Thread Dave Wood
On (19:50 03/01/09), Witold Filipczyk  put forth the 
proposition:
>On Sat, Jan 03, 2009 at 06:12:01PM +, Dave Wood wrote:
>> I've just caught the tail end of this thread since I haven't been on the
>> list very long.
>> 
>> I copied all the .js files in smjs to ~/.elinks/ but on youtube I get a
>> message saying my flash player is too old and another saying javascript is
>> turned off.
>> 
>> Is there something else I need to do to get this working?
>> 
>> I'm using the current-0.13 from git as of today 3rd Jan and didn't specify
>> any extra compile options.
>
>Here is the youtube2.js. To get the better quality one could add
>+ '&fmt=18' or even + '&fmt=22' after t[1].
>
>/* Play videos at YouTube with minimal niggling. Just load the page for a 
>video,
> * and the video will automatically be loaded. */
>function load_youtube(cached, vs) {
>   var par = 
> cached.uri.match(/http:\/\/\w+\.youtube\.com\/watch\?v=([^&]+).*/);
>   if (!par) return true;
>
>   var t = cached.content.match(/, \"t\": \"([^"]+)\"/);
>   if (!t) return true;
>
>   var url = 'http://uk.youtube.com/get_video?video_id=' +  par[1] + '&t=' 
> + t[1];
>
>   cached.content = 'View';
>
>   return true;
>}
>elinks.preformat_html_hooks.push(load_youtube);
>
>/* When one tries to follow a link to ,
> * redirect to , which has the information
> * that is necessary to get the actual video file. */
>function redirect_embedded_youtube(uri) {
>   var uri_match = uri.match(/http:\/\/\w+\.youtube\.com\/v\/([^&]+).*/);
>   if (!uri_match) {
>   return true;
>   }
>   return 'http://uk.youtube.com/watch?v=' + uri_match[1];
>}
>elinks.follow_url_hooks.push(redirect_embedded_youtube);
>/* end of file */
>
>The last few lines of the ~/.elinks/hooks.js:
>
>do_file(elinks.home + 'smartprefixes_bookmarks.js');
>do_file(elinks.home + 'smartprefixes_classic.js');
>do_file(elinks.home + 'youtube2.js');
>
>The ELinks was built this way:
>./autogen.sh && CFLAGS="-g2" ./configure --prefix=$HOME \
>   --enable-debug \
>   --disable-backtrace \
>   --enable-true-color \
>   --enable-256-colors \
>   --without-lzma \
>   --enable-bittorrent \
>   --without-x \
>   --enable-cgi \
>   --without-lua \
>   --with-python && make V=1
>
>I don't know whether the --without-lua is meaningful here.
>It works for me.
>Does Scripting(SpiderMonkey ECMAScript) is shown in the About?

Yes thanks. I'm downloading my first video now :)

I rebuilt a package using these options:

src2pkg -REAL -C -W -e="--enable-bittorrent \
--enable-cgi \
--enable-finger \
--enable-fsp \
--enable-gopher \
--enable-nntp \
--enable-smb \
--enable-88-colors \
--enable-256-colors \
--enable-true-color \
--enable-exmode \
--enable-html-highlight \
--enable-fastmem  \
--enable-combining" elinks-current-0.13.tar.bz2

Cheers

>
>Witek
>___
>elinks-users mailing list
>elinks-users@linuxfromscratch.org
>http://linuxfromscratch.org/mailman/listinfo/elinks-users

-- 
A physicist is an atom's way of knowing about atoms.
-- George Wald

___
elinks-users mailing list
elinks-users@linuxfromscratch.org
http://linuxfromscratch.org/mailman/listinfo/elinks-users


Re: [elinks-users] youtube.com in ELinks?

2009-01-03 Thread Witold Filipczyk
On Sat, Jan 03, 2009 at 06:12:01PM +, Dave Wood wrote:
> I've just caught the tail end of this thread since I haven't been on the
> list very long.
> 
> I copied all the .js files in smjs to ~/.elinks/ but on youtube I get a
> message saying my flash player is too old and another saying javascript is
> turned off.
> 
> Is there something else I need to do to get this working?
> 
> I'm using the current-0.13 from git as of today 3rd Jan and didn't specify
> any extra compile options.

Here is the youtube2.js. To get the better quality one could add
+ '&fmt=18' or even + '&fmt=22' after t[1].

/* Play videos at YouTube with minimal niggling. Just load the page for a video,
 * and the video will automatically be loaded. */
function load_youtube(cached, vs) {
var par = 
cached.uri.match(/http:\/\/\w+\.youtube\.com\/watch\?v=([^&]+).*/);
if (!par) return true;

var t = cached.content.match(/, \"t\": \"([^"]+)\"/);
if (!t) return true;

var url = 'http://uk.youtube.com/get_video?video_id=' +  par[1] + '&t=' 
+ t[1];

cached.content = 'View';

return true;
}
elinks.preformat_html_hooks.push(load_youtube);

/* When one tries to follow a link to ,
 * redirect to , which has the information
 * that is necessary to get the actual video file. */
function redirect_embedded_youtube(uri) {
var uri_match = uri.match(/http:\/\/\w+\.youtube\.com\/v\/([^&]+).*/);
if (!uri_match) {
return true;
}
return 'http://uk.youtube.com/watch?v=' + uri_match[1];
}
elinks.follow_url_hooks.push(redirect_embedded_youtube);
/* end of file */

The last few lines of the ~/.elinks/hooks.js:

do_file(elinks.home + 'smartprefixes_bookmarks.js');
do_file(elinks.home + 'smartprefixes_classic.js');
do_file(elinks.home + 'youtube2.js');

The ELinks was built this way:
./autogen.sh && CFLAGS="-g2" ./configure --prefix=$HOME \
--enable-debug \
--disable-backtrace \
--enable-true-color \
--enable-256-colors \
--without-lzma \
--enable-bittorrent \
--without-x \
--enable-cgi \
--without-lua \
--with-python && make V=1

I don't know whether the --without-lua is meaningful here.
It works for me.
Does Scripting(SpiderMonkey ECMAScript) is shown in the About?

Witek
___
elinks-users mailing list
elinks-users@linuxfromscratch.org
http://linuxfromscratch.org/mailman/listinfo/elinks-users


Re: [elinks-users] youtube.com in ELinks?

2009-01-03 Thread Dave Wood
On (17:54 03/01/09), Witold Filipczyk  put forth the 
proposition:
>On Fri, Jan 02, 2009 at 08:39:19PM +0100, Lars Bjørndal wrote:
>> Hello, list, and a happy new year to everyone!
>> 
>> Thomas Adam  writes:
>> 
>> > On 19/09/2007, cga2000  wrote:
>> >> I was wondering if there is any way I can cause ELinks to invoke a
>> >> media player when the selected link is something like:
>> >>
>> >> http://www.youtube.com/watch?v=ZbfrL4L5GME
>> >
>> > Look in:
>> >
>> > contrib/smjs
>> >
>> > In the ELinks source tarball (or a GIT clone).  Assuming you compile
>> > in spidermonkey support you can use the "youtube.js" file contained
>> > therein.
>> 
>> I've tried that, but I cannot get it working. One of the links I've
>> tried, is the link: http://de.youtube.com/watch?v=GWpV7L4YHuU
>> 
>> I've put the hook.js and youtube.js files into my .elinks directory
>> and restarted Elinks (version 0.13-GIT from three days ago) Could the
>> problem be that the characters ".de." is preceding youtube.com in the
>> link? Or maybe this is not possible at all from a poor console? I'd
>> like to use mplayer, if possible. Should that be possible to do?
>
>I added the youtube2.js to the elinks-0.13. It shows a page with a link
>instead of the "refresh". In the hooks.js add:
>do_file("youtube2.js"); Anyway the ELinks always download the whole file
>before playing.

I've just caught the tail end of this thread since I haven't been on the
list very long.

I copied all the .js files in smjs to ~/.elinks/ but on youtube I get a
message saying my flash player is too old and another saying javascript is
turned off.

Is there something else I need to do to get this working?

I'm using the current-0.13 from git as of today 3rd Jan and didn't specify
any extra compile options.


>
>Witek
>___
>elinks-users mailing list
>elinks-users@linuxfromscratch.org
>http://linuxfromscratch.org/mailman/listinfo/elinks-users

-- 
Winter is the season in which people try to keep the house as warm as
it was in the summer, when they complained about the heat.

___
elinks-users mailing list
elinks-users@linuxfromscratch.org
http://linuxfromscratch.org/mailman/listinfo/elinks-users


Re: [elinks-users] youtube.com in ELinks?

2009-01-03 Thread Witold Filipczyk
On Fri, Jan 02, 2009 at 08:39:19PM +0100, Lars Bjørndal wrote:
> Hello, list, and a happy new year to everyone!
> 
> Thomas Adam  writes:
> 
> > On 19/09/2007, cga2000  wrote:
> >> I was wondering if there is any way I can cause ELinks to invoke a
> >> media player when the selected link is something like:
> >>
> >> http://www.youtube.com/watch?v=ZbfrL4L5GME
> >
> > Look in:
> >
> > contrib/smjs
> >
> > In the ELinks source tarball (or a GIT clone).  Assuming you compile
> > in spidermonkey support you can use the "youtube.js" file contained
> > therein.
> 
> I've tried that, but I cannot get it working. One of the links I've
> tried, is the link: http://de.youtube.com/watch?v=GWpV7L4YHuU
> 
> I've put the hook.js and youtube.js files into my .elinks directory
> and restarted Elinks (version 0.13-GIT from three days ago) Could the
> problem be that the characters ".de." is preceding youtube.com in the
> link? Or maybe this is not possible at all from a poor console? I'd
> like to use mplayer, if possible. Should that be possible to do?

I added the youtube2.js to the elinks-0.13. It shows a page with a link
instead of the "refresh". In the hooks.js add:
do_file("youtube2.js"); Anyway the ELinks always download the whole file
before playing.

Witek
___
elinks-users mailing list
elinks-users@linuxfromscratch.org
http://linuxfromscratch.org/mailman/listinfo/elinks-users


Re: [elinks-users] youtube.com in ELinks?

2009-01-02 Thread Lars Bjørndal
Hello, list, and a happy new year to everyone!

Thomas Adam  writes:

> On 19/09/2007, cga2000  wrote:
>> I was wondering if there is any way I can cause ELinks to invoke a
>> media player when the selected link is something like:
>>
>> http://www.youtube.com/watch?v=ZbfrL4L5GME
>
> Look in:
>
> contrib/smjs
>
> In the ELinks source tarball (or a GIT clone).  Assuming you compile
> in spidermonkey support you can use the "youtube.js" file contained
> therein.

I've tried that, but I cannot get it working. One of the links I've
tried, is the link: http://de.youtube.com/watch?v=GWpV7L4YHuU

I've put the hook.js and youtube.js files into my .elinks directory
and restarted Elinks (version 0.13-GIT from three days ago) Could the
problem be that the characters ".de." is preceding youtube.com in the
link? Or maybe this is not possible at all from a poor console? I'd
like to use mplayer, if possible. Should that be possible to do?

Thans in advance
Lars
___
elinks-users mailing list
elinks-users@linuxfromscratch.org
http://linuxfromscratch.org/mailman/listinfo/elinks-users


Re: [elinks-users] youtube.com in ELinks?

2008-10-05 Thread Lars Bjørndal
Thomas Adam <[EMAIL PROTECTED]> writes:

> On 19/09/2007, cga2000 <[EMAIL PROTECTED]> wrote:
>> I was wondering if there is any way I can cause ELinks to invoke a
>> media player when the selected link is something like:
>>
>> http://www.youtube.com/watch?v=ZbfrL4L5GME
>
> Look in:
>
> contrib/smjs
>
> In the ELinks source tarball (or a GIT clone).  Assuming you compile
> in spidermonkey support you can use the "youtube.js" file contained
> therein.

What exactly do you need to do with the file youtube.js? Place it into
the .elinks directory, but do you also need the hooks.js? I'm running
from the console, should that work as well?

Lars
-- 
Lars Bjørndal <[EMAIL PROTECTED]>
Storetveitåsen 15, 5067 Bergen.
Tlf.: 55 28 29 98  Mobil: 958 37 537  Telefaks: 55 28 40 67
___
elinks-users mailing list
elinks-users@linuxfromscratch.org
http://linuxfromscratch.org/mailman/listinfo/elinks-users


Re: [elinks-users] youtube.com in ELinks?

2007-10-21 Thread cga2000
On Wed, Sep 19, 2007 at 06:46:50PM EDT, Thomas Adam wrote:
> On 19/09/2007, cga2000 <[EMAIL PROTECTED]> wrote:
> > I was wondering if there is any way I can cause ELinks to invoke a
> > media player when the selected link is something like:
> >
> > http://www.youtube.com/watch?v=ZbfrL4L5GME
> 
> Look in:
> 
> contrib/smjs
> 
> In the ELinks source tarball (or a GIT clone).  Assuming you compile
> in spidermonkey support you can use the "youtube.js" file contained
> therein.
> 
> -- Thomas Adam

Sorry for the delay.

I have a contrib/smjs/google_video.js file but no youtube.js.

I would have given that a try but I'm unsure how.  

Do I need to use some form of URI-passing technique?

Thanks,
cga
___
elinks-users mailing list
elinks-users@linuxfromscratch.org
http://linuxfromscratch.org/mailman/listinfo/elinks-users


Re: [elinks-users] youtube.com in ELinks?

2007-09-20 Thread Willem van der Walt
Hi,
I have just received this on another list.
This might also be an option here.
I have not used atall, so just passing on the info.

I'm sending this to several public forums, (and several
private individuals) but not by CC:  to avoid crosspost
message bounce hell.

As a courtesy to everyone to let them know where I'm sending this:

Lynx-dev:
mailto:[EMAIL PROTECTED]
http://lists.nongnu.org/mailman/options/lynx-dev/

Mplayer-users:
mailto:[EMAIL PROTECTED]
http://lists.mplayerhq.hu/mailman/listinfo/mplayer-users

Rexx Language Association:
mailto:[EMAIL PROTECTED]
http://www.rexxla.org
(for nonmembers perhaps, news://comp.lang.rexx)

(Los Angeles) LAMP SIG:
mailto:[EMAIL PROTECTED]
http://www.lampsig.org/

Feel free to forward this to any other place you want.

The purpose of this message is to announce a Rexx
script, 'usnatch' downloadable from:

http://www.lafn.org/~aw585/usnatch

This announcement is online at:

http://www.lafn.org/~aw585/usnatch.txt

This script is used in conjunction with the Lynx text mode
browser as an 'EXTERN', and with mplayer allows the user
to play videos from several sites such as www.youtube.com, video.google.com
and such, with mplayer, all as a convenience to the user,
trying to avoid roadblocks created by javascript.

If their mplayer is configured to use drivers
such as svga, vesa, aalib, nvidia console driver, or even null
(in some cases the most important one),
the user can play the videos without a GUI.
It can be run from the command line, and though not tested,
I see no reason it can't be run from other browsers.
(Let me know about any success or problems with that)
It can probably be adapted to use other video players
with little trouble if desired.

The user must choose to run the EXTERNAL program,
deciding if he trusts the media source, and activating the
default EXTERNAL (if only one is defined), or the EXTERNAL menu
(if more than one EXTERNAL program is configured) for the URL type,
by typically pressing the ',' (for the current page) or '.'
(for the current link) keys.

>From the command line the program might typically be run by:

$usnatch 'http://www.youtube.com/watch?v=zAGylaoBt6M' -i -p

or inside the Lynx config file:

EXTERNAL:http:usnatch %s -i -a:TRUE


The program started out as a late night hack to scrape
the actual flash video (.flv) link from the http://videodownloader.net
page in the backend and then play the video. 
It has since been expanded to scrape directly from
www.youtube.com when appropriate, using the algorithm from 
the youtube-dl program (http://www.arrakis.es/~rggi3/youtube-dl/),
or from http://KeepVid.com,
or even try a few guesses that have sometimes worked in the past
if nothing else works.

The main point of the program is to handle the
interactions of URLs found using lynx,
the getting of video URLs from the download helper sites,
and mplayer, all as a convenience to the user.
I first used some of the screen scraping techniques in it
when fixing a program to email my L.A. public library
account summaries nightly.

Two weeks after writing this script, I ran into another fellow Lynx user
at a local LUG meeting.  Especially as this gentleman is totally blind,
a news junky and there being so much content on sites such as Youtube,
that he had no access to, Usnatch quite fits the bill.


Rant:

There are many ways to render a web page.  Leaving aside considerations
like tactile or audio presentation of the data, a few, with possible
gradations between them, are:

1. a simple dump of the html etc.
2. text mode rendering, as in a simple text mode browser
3. text mode rendering with links to images and multimedia content 
4. graphical mode rendering the includes images and possibly other media
5. As a checksum to for detecting changes in the content.
6. as a list of links, as Lynx does with '-dump -listonly' or when
   'L' (LIST command typically bound to the 'L' key) is pressed.
   This view I like to think of as the 'Google' view of a page.
   My understanding is that they based their search algorithms on the idea
   that this was typically the most important information on a web page,
   and this mode instantly renders it.
7. As a listing of the header-metadata in a page.  I personally know of no
   software that shows this, and am thinking about writing one.

   This last item is starting to drift off into semantic web concerns,
   where probably they have dealt with it.

End of rant.

Some observations:

The build for some 'Red Hat' derived Linux systems don't seem to have
the Lynx '-listonly' switch by default (this is easily worked around,
but awkward).  Odd, because some people think of Lynx first
when trying to extract URLs from html. 

Apparently the default Lynx build for some BSD systems
do not have EXTERNAL capability.

It would be nice for some people if wget had an odometer style download
progress report mode, like Lynx's, with capability somewhere between no
progress report and the 'dot' character graphic report.

Prehaps a s

Re: [elinks-users] youtube.com in ELinks?

2007-09-19 Thread cga2000
On Wed, Sep 19, 2007 at 06:46:50PM EDT, Thomas Adam wrote:
> On 19/09/2007, cga2000 <[EMAIL PROTECTED]> wrote:
> > I was wondering if there is any way I can cause ELinks to invoke a
> > media player when the selected link is something like:
> >
> > http://www.youtube.com/watch?v=ZbfrL4L5GME
> 
> Look in:
> 
> contrib/smjs
> 
> In the ELinks source tarball (or a GIT clone).  Assuming you compile
> in spidermonkey support you can use the "youtube.js" file contained
> therein.

Thank you Thomas!

I will look into this and let you know.

cga
___
elinks-users mailing list
elinks-users@linuxfromscratch.org
http://linuxfromscratch.org/mailman/listinfo/elinks-users


Re: [elinks-users] youtube.com in ELinks?

2007-09-19 Thread Thomas Adam
On 19/09/2007, cga2000 <[EMAIL PROTECTED]> wrote:
> I was wondering if there is any way I can cause ELinks to invoke a
> media player when the selected link is something like:
>
> http://www.youtube.com/watch?v=ZbfrL4L5GME

Look in:

contrib/smjs

In the ELinks source tarball (or a GIT clone).  Assuming you compile
in spidermonkey support you can use the "youtube.js" file contained
therein.

-- Thomas Adam
___
elinks-users mailing list
elinks-users@linuxfromscratch.org
http://linuxfromscratch.org/mailman/listinfo/elinks-users