Comments (4)
I never used this script, too cursed for my liking and I don't download music. However, I helped someone fix this issue.
Lines 270 to 271 in ba98ec5
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):
Lines 268 to 275 in ba98ec5
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.
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
Lines 270 to 271 in ba98ec5
Basically replace with:
contentSoup = soup.find(id='pageContent') if contentSoup.find_all('h2')[0].string == "No such album":
from khinsider.
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.
Chances are it did, do you think the URL for the Khinsider changed?
from khinsider.
Related Issues (20)
- What am I doing wrong? (first time using python) HOT 1
- Any proxy function?
- Flac doesn't work? HOT 1
- Cant download from URL HOT 1
- Can't add \ to download argument HOT 1
- Command Prompt Crashes When Loading Script.
- script prints list of image files
- Error Message
- Error message-no url specified even if present
- Doesnt work.
- I Can't Download any music or hear any music! HOT 1
- Obsolete Guide HOT 4
- Could not connect to KHInsider HOT 1
- Cannot use tool due to [AttributeError: 'NoneType' object has no attribute 'find'] HOT 1
- You guys represent everything wrong with Github. Such a simple thing made impossible to use for casual users HOT 5
- Obligatory report
- khinsider New Error
- On some URLs, 'info' is appended to the title of the Soundtrack HOT 1
- Please Transform This Script into a Simple GUI Program HOT 4
- https://downloads.khinsider.com is down HOT 1
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 khinsider.