[BUG]: When running `ytfzf -f -cSI` against some instances a jq error is reported and nothing is scraped
Describe the bug
When attempting to run ytfzf -f -cSI using my subscriptions file (added .txt to make github happy) some instances fail with:
jq: error (at <stdin>:0): Cannot index array with string "type"
This error is repeated twice for every subscription, so in my case 26 times followed by [ERROR]: Nothing was scraped once at the end.
This only happens for some instances, and at first I thought it was only a few that were not responding correctly but it has become more and more common over the last few days. I suspect a change in invidious is causing this and it is slowly propagating as instances are updating.
To Reproduce
Run ytfzf -f -c SI with the attached subscription file above. I have tested mostly with a clean cache and empty config file.
Expected behavior
Should see an fzf list of matching content for all subscriptions. Instead I see the errors listed above.
Screenshots
Nothing is really shown other than the error above so I don't think a screenshot would be helpful.
Information
- OS: Archlinux
- Terminal:
alacritty - Ytfzf version:
ytfzf: 2.5.4.rc-3 - Output of
ls -l "$(which sh)"(if you're using fish:ls -l (which sh)):lrwxrwxrwx 1 root root 4 Jan 8 2022 /usr/sbin/sh -> bash* - (if is a thumbnail issue) run
ytfzf --thumbnail-log=log.txtand post the file: It is not a thumbnail issue.
Additional context
I use the git version of ytfzf from the aur which is based on the development branch of this repo:
source=('ytfzf::git+https://github.com/pystardust/ytfzf.git#branch=development')
This does not happen when using youtube directly via ytfzf -f -cS
Thanks as always. I really appreciate all your work on this project. Let me know what other information might help.
I suspect a change in invidious is causing this and it is slowly propagating as instances are updating.
I suspect you're right. I looked through the documentation to see if there's new stuff. What i found was that the endpoint scrape_invidious_channel uses doesn't exist anymore.
I have a potential solution in mind, i'll work on it in a couple hours.
I've been using my own instance so i didn't notice :sweat_smile:
edit:
In the meantime, either set invidious_instance in the config file to an instance that works, or use the -c S scraper like you mentioned.
Sorry it's been more than a couple hours, lol. Anyway, I implemented the fix i thought about and it worked with more downsides than i liked. Mainly, the view count doesn't work.
I dug a bit deeper and i found that the end point that is currently being used does work, however they completely changed the JSON layout, so I'm going to try to make the scraper compatible with both jsons.
I believe the issue has been fixed, and pushed to the development branch, the ytfzf-git package uses the development branch, so just update the package.
Sorry it's been more than a couple hours, lol.
No worries at all! I know you probably do this in your free time.
I believe the issue has been fixed
I just tested with the updated -git package and everything looks good to me. I tested a bunch of different instances some which worked before and some that didn't. They all appear to be fine now and I'm no longer receiving any errors from jq. Thanks for taking a look so quickly.
I know you probably do this in your free time.
Indeed.
Thanks for taking a look so quickly.
Yw.
I'll close this issue, after the next release.