Comments (17)
Hi, thanks for reporting this. I will have a look under Ubuntu 14.04 soon and get back to you.
What is the output you get for python --version
?
from yewtube.
Here it is:
python --version
Python 2.7.6
from yewtube.
I just tried it in Ubuntu 13.10 (under VirtualBox) and the same error occurs, so it's not an Ubuntu 14.04 specific issue...
from yewtube.
That's odd. I can't reproduce the error. I see you have said that it's not 14.04 specific but I had already started testing it with that since you first mentioned it. I downloaded the daily build of Trusty-desktop, booted it from usb, sudo apt-get install mplayer
, sudo apt-get install python-pip
, sudo pip install mps-youtube
, mpsyt
,
Then within mpsyt:
pls volbeat
1
1
it plays the item without any error.
I also can't reproduce the error with my main setup (xubuntu 13.10)
Does it work for you using playlist searches other than "volbeat" ?
Are you installing using pip? What is the pafy version reported when you enter mpsyt --version
? It should be 0.3.39.
from yewtube.
It works for me flawlessly on Ubuntu 13.10 and 12.04. Perhaps @hotice has some sort of custom system config?
from yewtube.
Yes, it was installed using PIP and I'm using the latest version:
mpsyt --version
mpsyt version: 0.01.37
pafy version: 0.3.39
Python version: 2.7.6 (default, Feb 26 2014, 13:22:43)
[GCC 4.8.2]
Since it also occurs for me in VirtualBox in Ubuntu 13.10... it means that somehow it can be reproduced. I tried completely purging mps-youtube and pafy but the error still occurs.
from yewtube.
Also, I tried other playlists (other searches) but I get the same error...
from yewtube.
Well I am pretty confused then! Maybe CPU architecture related? All my tests were on i386 builds. I could try the amd64 build of 14.04...
from yewtube.
I'm using Ubuntu 14.04 64bit but my VirtualBox test was in a 32bit machine.
Also, I've search for this error and simply running this in python will display the same error message (maybe this helps):
int('')
from yewtube.
Yes, it's (rightly) failing to convert a string that doesn't look like an int (because of the decimal point) into an int. I have dozens of calls to int() in the code for pafy and mpsyt. Without being able to reproduce the error it's very difficult to see where it's getting this value from. I have made changes with less error-catching so when it fails it will hopefully print a traceback with the line numbers. If you wouldn't mind testing it you can download it from: https://raw.github.com/np1/mps-youtube/issue35/mpsyt
then chmod +x mpsyt
./mpsyt
and repeat the test again.
I will include debugging options in a future version of mpsyt to make it easier to determine where faults are coming from.
from yewtube.
Here's the output:
Retreiving YouTube playlist
Traceback (most recent call last):
File "./mpsyt", line 2592, in <module>
main()
File "./mpsyt", line 2569, in main
globals()[func](*matches)
File "./mpsyt", line 1672, in play
return plist(g.ytpls[int(choice) - 1]['link'])
File "./mpsyt", line 2364, in plist
yt_playlist = pafy.get_playlist(parturl)
File "/usr/local/lib/python2.7/dist-packages/pafy.py", line 1143, in get_playlist
pafy_obj.populate_from_playlist(vid_data)
File "/usr/local/lib/python2.7/dist-packages/pafy.py", line 1059, in populate_from_playlist
self._viewcount = int(pl_data.get("views", 0).replace(",", ""))
ValueError: invalid literal for int() with base 10: '10.104.974'
from yewtube.
Great! That's a big help! The viewcounts I was getting from YouTube had comma separators for views over 999. I removed the commas in pafy so that I could interpret the number as an integer (replace(",", "")
. For some reason (maybe locale related) your data has .
separators for the thousands. I will get working on a fix for this.
from yewtube.
Great!
from yewtube.
I have changed the replace() function in pafy to a regular expression that extracts just the digits (https://github.com/np1/pafy/commit/9ff12b36e2f785af2d9504184cc13b17690a54b1). According to Wikipedia the Swiss and Italians use 1˙234˙567,89
style numbers, other countries use dots, spaces or commas as the thousands separator. I don't know how YouTube determines which to serve, probably geocoding the IP address. Anyway, as long as they don't start serving Roman numerals we should be ok!
The change is available on the develop
branch of pafy and will be in the next release.
from yewtube.
Thanks for the fix! I'll be waiting for the new release.
from yewtube.
I have released new versions of mps-youtube and pafy (0.01.38 and 0.3.41).
Doing a pip upgrade of mps-youtube should update them both.
from yewtube.
It works now, thank you!
from yewtube.
Related Issues (20)
- Can't change yt.dlp yewtube uses even after installing the newer one in all the ways I coud HOT 1
- Playback stops after a few seconds HOT 4
- WSL compatility : Youtube Error 403: The request cannot be completed because you have exceeded your <a href="/youtube/v3/getting-started#quota">quota</a>. HOT 2
- YouTube music support HOT 1
- Control audio via mpris/playerctl (next/prev)
- howto download an audio without the menu ? HOT 1
- regression with the latest version ? ( or issue on the method to update? ) HOT 1
- videos not showing up when using `-w` flag
- Your input can't be opened HOT 1
- Support py3.12 HOT 1
- 'NoneType' object has no attribute 'add_cmd'
- Yewtube v2.10.4 suggests upgrading to v2.9.2 HOT 3
- A way to queue/shuffle the entire playlist rather than just the visible entries HOT 1
- Feature Request: Spotify Playlist
- yt command doesn't work HOT 3
- Is it possible to use ffmpeg instead for video playback? HOT 3
- Issue with loading mpv config files HOT 2
- Error when starting the script HOT 2
- [Feature Request] Display current chapter
- how to JUST PLAY AUDIO please guide without missing any step :-)) HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yewtube.