Giter VIP home page Giter VIP logo

Comments (17)

np1 avatar np1 commented on July 28, 2024

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.

hotice avatar hotice commented on July 28, 2024

Here it is:

python --version
Python 2.7.6

from yewtube.

hotice avatar hotice commented on July 28, 2024

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.

np1 avatar np1 commented on July 28, 2024

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.

 avatar commented on July 28, 2024

It works for me flawlessly on Ubuntu 13.10 and 12.04. Perhaps @hotice has some sort of custom system config?

from yewtube.

hotice avatar hotice commented on July 28, 2024

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.

hotice avatar hotice commented on July 28, 2024

Also, I tried other playlists (other searches) but I get the same error...

from yewtube.

np1 avatar np1 commented on July 28, 2024

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.

hotice avatar hotice commented on July 28, 2024

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.

np1 avatar np1 commented on July 28, 2024

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.

hotice avatar hotice commented on July 28, 2024

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.

np1 avatar np1 commented on July 28, 2024

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.

hotice avatar hotice commented on July 28, 2024

Great!

from yewtube.

np1 avatar np1 commented on July 28, 2024

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.

hotice avatar hotice commented on July 28, 2024

Thanks for the fix! I'll be waiting for the new release.

from yewtube.

np1 avatar np1 commented on July 28, 2024

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.

hotice avatar hotice commented on July 28, 2024

It works now, thank you!

from yewtube.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.