Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
99 user(s) are online (89 user(s) are browsing Forums)

Members: 0
Guests: 99

more...

Support us!

Headlines

 
  Register To Post  

Python 2.6 available somewhere ?
Just can't stay away
Just can't stay away


See User information
Hi,
As SMTube will be soon unable to view/download YouTube videos, his author rvm will maybe make a new program that could use "youtube-dl" python script.

I tried to launch it but it complains about

3/1.RAM Disk:> python youtube-dl
File "youtube-dl", line 2
SyntaxError: Non-ASCII character '\x9c' in file youtube-dl on line 2, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details


I tried to add some "# coding: " but it doesn't work.

Until I read that

"The error

File "youtube-dl", line 2
SyntaxError: Non-ASCII character '\x93' ...

means you're using an outdated version of Python. Please update to Python 2.6 or 2.7"

https://github.com/rg3/youtube-dl/#syntaxerror-non-ascii-character

Therefore, is an newer Python version than 2.5.6 is planned on OS4 ?

Thank you



Go to top
Re: Python 2.6 available somewhere ?
Home away from home
Home away from home


See User information
@zzd10h

Not that I'm aware at the moment (though I don't speak for the OS dev team).

But where is the script?

This doesn't sound like a fixabkle only by upgrading issue to me....



Go to top
Re: Python 2.6 available somewhere ?
Just can't stay away
Just can't stay away


See User information
@broadblues

About upgrading need, it's what is said in the FAQ.

The script can be found here :

https://yt-dl.org/downloads/2015.04.28/youtube-dl

Thank you to try it.

Go to top
Re: Python 2.6 available somewhere ?
Home away from home
Home away from home


See User information
@zzd10h

Just before you replied I downloaded from a link on the doc page and first thing to observer is that your encoding related error is "bogus" the problem is not about encoding but about the fact the "script" is infact a zipped archive with a #/usr/bin/enn python header

Our python does not support that, so stripping the python header so that UNARC can see it as a ZIP I get the directory and __main__.py

Executing that we start to get some 'real errors'

Problem one:

it uses

from __future__ import unicode_literals

that is indeed a 2.6 feature or rather a backport from 3.0 you could get arround this one by finding the unicode literals and putting u'stringliteral'

Problem two:

Usage of with syntax.

Not really problem as it comes with 2.5 but needs the

from __future__ import with_statement

at the head of any file using it.

Third issue

needs the io module which we don't have


So potentially portable but with a bit of hassle.

I wonder if it would be easier to use the google reference python module for the newer youtube API ?

You could then make a cleaner port to AmigaOS and build your own application arround it?

Go to top
Re: Python 2.6 available somewhere ?
Just can't stay away
Just can't stay away


See User information
@broadblues
Many thanks for these precises explanations.

I never used Python and therefore will be very difficult for me to develop a new "smtube" beside all the time that I spend on my own zTools.


Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project