GithubHelp home page GithubHelp logo

Error while downloading Album about khinsider HOT 4 CLOSED

obskyr avatar obskyr commented on August 16, 2024
Error while downloading Album

from khinsider.

Comments (4)

kamilkrzyskow avatar kamilkrzyskow commented on August 16, 2024 2

I never used this script, too cursed for my liking and I don't download music. However, I helped someone fix this issue.

khinsider/khinsider.py

Lines 270 to 271 in ba98ec5

contentSoup = soup.find(id='EchoTopic')
if contentSoup.find('p').string == "No such album":

Basically replace with:

contentSoup = soup.find(id='pageContent')
if contentSoup.find_all('h2')[0].string == "No such album":

It will not raise an error for valid album IDs, but will break when providing invalid album IDs
That someone checked it with the base example of khinsider.py jumping-flash and it worked.

The solution below wasn't tested and will still raise an error when providing invalid album IDs:

You can technically remove the "No such album" check as it's not a valid check (as it'll never be true):

khinsider/khinsider.py

Lines 268 to 275 in ba98ec5

def _contentSoup(self):
soup = getSoup(self.url)
contentSoup = soup.find(id='EchoTopic')
if contentSoup.find('p').string == "No such album":
# The EchoTopic and p exist even if the soundtrack doesn't, so no
# need for error handling here.
raise NonexistentSoundtrackError(self)
return contentSoup

Basically replace with:

def _contentSoup(self):
    soup = getSoup(self.url)
    contentSoup = soup.find(id='pageContent')
    return contentSoup

OR

def _contentSoup(self):
    return getSoup(self.url).find(id='pageContent')

from khinsider.

ImMalding avatar ImMalding commented on August 16, 2024 1

OR

def _contentSoup(self):
    return getSoup(self.url).find(id='pageContent')

This solution worked for me! Thank you so much!

Edit: The solution above wasn't entirely reliable, so I went with the first solution you offered, which seems to be more consistent. Seems to skip album art tho, but thanks regardless

khinsider/khinsider.py

Lines 270 to 271 in ba98ec5

contentSoup = soup.find(id='EchoTopic')
if contentSoup.find('p').string == "No such album":

Basically replace with:

contentSoup = soup.find(id='pageContent')
if contentSoup.find_all('h2')[0].string == "No such album":

from khinsider.

T-Craig avatar T-Craig commented on August 16, 2024

Getting the same issue as you. I'm using the code in a program I wrote so it's a little different but same idea. What the issue is, I can't tell. Same error for every album I try, I can only assume something got changed on the kh backend?

  File "D:/Python Projects/khInsider/runner.py", line 33, in <module>
    khinsider.download(soundtrackName, path=path, makeDirs=True, formatOrder=None, verbose=True)
  File "D:\Python Projects\khInsider\khinsider.py", line 413, in download
    return Soundtrack(soundtrackId).download(path, makeDirs, formatOrder, verbose)
  File "D:\Python Projects\khInsider\khinsider.py", line 325, in download
    for song in self.songs:
  File "D:\Python Projects\khInsider\khinsider.py", line 149, in lazyVersion
    setattr(self, attrName, func(self))
  File "D:\Python Projects\khInsider\khinsider.py", line 288, in songs
    table = self._contentSoup.find('table', id='songlist')
  File "D:\Python Projects\khInsider\khinsider.py", line 149, in lazyVersion
    setattr(self, attrName, func(self))
  File "D:\Python Projects\khInsider\khinsider.py", line 271, in _contentSoup
    if contentSoup.find('p').string == "No such album":
AttributeError: 'NoneType' object has no attribute 'find'

from khinsider.

RGPZ avatar RGPZ commented on August 16, 2024

Chances are it did, do you think the URL for the Khinsider changed?

from khinsider.

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.