-
Notifications
You must be signed in to change notification settings - Fork 48
TypeError: Cannot read property '4' of null #84
Comments
I can confirm that this issue is happening to me too |
i have been getting the same (node:3956) UnhandledPromiseRejectionWarning: TypeError: Cannot read property '4' of null |
Ya this happened to me too. Pretty weird how it worked just several hours ago but now it is giving errors. |
🤔 looks like we're in for the same changes as ytsr |
I had a quick look. The regex is failing. Seems like the HTML has changed. The initial error started with authorMatch and then fails at the playlist as well. |
Any idea of when a fix is going to happen? |
I'm going to investigate it tomorrow, and hopefully find a fix that works for me. If I'm finding one, I'm going to open a PR. |
The response body from youtube has dramatically changed. It seems that now it returns a sort of javascript object where most of the data can be retrieved. I've included a dump of that object that I got from firstpage.js at line 14. |
I've almost finished fixing the function getGeneralInfo in /lib/utils.js. |
I uploaded my fix, I don't know if it will be merged, but feel free to use it while waiting for an official merge or improvement. You can find it in the pull requests. |
Thanks heaps! |
Doesn't seem to be working even after updating that file |
I've a couple ideas why it's not working. Please send me the playlists you are using, so I can understand why it happens |
I updated the util.js file to what you made it unless I did something wrong? |
@dbrn check my comments in the pull request if you want more playlist not working. i got a error with json.parse and another one with string.replace(/\n\r?/g, ' ') thanks |
I'm giving it a look just now :) |
Thank you everybody for your feedback and links!. |
This repo is very slow and inactive. Just use youtube-dl or YouTube's data API which can fetch playlist details easily |
Some people would have to rewrite their code to switch libraries. Finding a way to make it work again could be an easier solution. |
Also, I much prefer the promise based coding format of this library rather than the event listening based format of something like youtube-dl. |
I agree with you, but if it takes such a long time to update this library every time it breaks, it's time to consider switching to a more reliable library. Secondly, take a look into YouTube's data API and see if it fits your needs. I switched to it after ytpl broke and I'm finding it to be very fast and more reliable. Plus it has a quota of 10,000 free requests per day which is more than enough in most cases. |
I always recommend the official api but it doesn't fit everyone's needs
Gotta defend myself. |
Fair enough. Hope you're doing well. Tbh I don't mind waiting. I much much prefer your libraries because of the promise based coding. Also because it's fully anonymous youtube downloader. |
@dbrn where's your code? I don't see a PR @TimeForANinja I think we could apply evolutionary algos to traversing a parsed HTML or a bunch of parsing rules and run them on known playlists with expected output. I don;t really know how this library works exactly - the magic of using a library instead of rolling your own ;) |
no idea if it work's but just throwing ML at everything would crush efficiency |
I meant to produce patches with them, not to use them in runtime. I took a look at the page source of a playlist and got another idea - to make a fuzzy search on paths in json. [edit] |
- [x] fix requests - [x] update exaple responses - [x] update typings - [x] update documentation / README - [x] rewrite tests closes #72 closes #83 closes #84 closes #100 # Porting code * request options for miniget were moved to `options#requestOptions` * nextpageRef was replaced by the continuation feature => check the README for more information * `pages` was added as a more request-efficient alternative to `limit` * `playlist#visibility#link_only` was renamed to `unlisted` * all thumbnails are now Objects of type `Image` featuring `url`, `width` and `height` properties - arrays of images are always sorted by descending resolution * all links have been renamed from `ref` to `url` to keep it consistend across all libraries * all snake_case variables were replaced by CamelCase * `response#result_items` is now `response#estimatedItemCount` * all users/channels feature both the `channelID` as well as a canonical `url`
TypeError: Cannot read property '4' of null
version installed: 1.0.1
The text was updated successfully, but these errors were encountered: