Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Broken V1 api when adding ?type and &region #2021

Closed
Win-DVD opened this issue Apr 18, 2021 · 4 comments · Fixed by #2195
Closed

[Bug] Broken V1 api when adding ?type and &region #2021

Win-DVD opened this issue Apr 18, 2021 · 4 comments · Fixed by #2195
Labels
bug Something isn't working type:api

Comments

@Win-DVD
Copy link

Win-DVD commented Apr 18, 2021

Describe the bug
no matter what URL you use the V1 API refuses to connect when you add the ?type flag. Example is "https://invidious.snopyta.org/api/v1/trending?type=music&region=US" it refuses to work. Despite the fact that it used to.

Steps to Reproduce

  1. Go to 'https://invidious.snopyta.org/api/v1/trending?type=music&region=US' (Or any of the Invidious URL's)
  2. See error

Logs
Varies from server to server but it always does some variation of it.

error "Expected Hash for #[](key : String), not Array(JSON::Any)"
errorBacktrace "Expected Hash for #[](key : String), not Array(JSON::Any) (Exception)\n from /usr/share/crystal/src/json/any.cr:102:7 in '[]'\n from src/invidious/trending.cr:20:11 in 'fetch_trending'\n from src/invidious.cr:2199:22 in '->'\n from /usr/share/crystal/src/primitives.cr:255:3 in '->'\n from /usr/share/crystal/src/primitives.cr:255:3 in 'process_request'\n from lib/kemal/src/kemal/route_handler.cr:17:7 in 'call'\n from /usr/share/crystal/src/http/server/handler.cr:28:7 in 'call_next'\n from lib/kemal/src/kemal/websocket_handler.cr:13:14 in 'call'\n from /usr/share/crystal/src/http/server/handler.cr:28:7 in 'call_next'\n from lib/kemal/src/kemal/filter_handler.cr:21:7 in 'call'\n from /usr/share/crystal/src/http/server/handler.cr:28:7 in 'call_next'\n from src/invidious/helpers/handlers.cr:212:5 in 'call'\n from /usr/share/crystal/src/http/server/handler.cr:28:7 in 'call_next'\n from src/invidious/helpers/handlers.cr:94:12 in 'call'\n from /usr/share/crystal/src/http/server/handler.cr:28:7 in 'call_next'\n from src/invidious/helpers/handlers.cr:158:7 in 'call'\n from /usr/share/crystal/src/http/server/handler.cr:28:7 in 'call_next'\n from src/invidious/helpers/handlers.cr:70:5 in 'call'\n from /usr/share/crystal/src/http/server/handler.cr:28:7 in 'call_next'\n from src/invidious/helpers/static_file_handler.cr:189:11 in 'call'\n from /usr/share/crystal/src/http/server/handler.cr:28:7 in 'call_next'\n from lib/kemal/src/kemal/exception_handler.cr:8:7 in 'call'\n from /usr/share/crystal/src/http/server/handler.cr:28:7 in 'call_next'\n from src/invidious/helpers/logger.cr:17:35 in 'call'\n from /usr/share/crystal/src/http/server/handler.cr:28:7 in 'call_next'\n from lib/kemal/src/kemal/init_handler.cr:12:7 in 'call'\n from /usr/share/crystal/src/http/server/request_processor.cr:50:11 in 'process'\n from /usr/share/crystal/src/http/server.cr:513:5 in 'handle_client'\n from /usr/share/crystal/src/http/server.cr:468:13 in '->'\n from /usr/share/crystal/src/primitives.cr:255:3 in 'run'\n from /usr/share/crystal/src/fiber.cr:92:34 in '->'\n from ???\n"

Additional context

  • Browser (if applicable): Firefox 86
  • OS (if applicable): Windows 10
    -->
@Win-DVD Win-DVD added the bug Something isn't working label Apr 18, 2021
@Win-DVD Win-DVD changed the title [Bug] Broken V1 api when adding ?type- and after &region= [Bug] Broken V1 api when adding ?type and &region Apr 18, 2021
@SamantazFox
Copy link
Member

It seems that this is the type parameter that causes this error.

@mrpaul92
Copy link

mrpaul92 commented Jun 3, 2021

when it is going to be fixed ?

@SamantazFox
Copy link
Member

When someone will have time to work on it :)

Sorry if it's not fast, but we're only a few people behind this project, and only a few of us do code in crystal. Some important things are already being worked on, like #1981, which, combined with a rewrite of the youtube client side of invidious, will allow the use of &region= parameters. PR #1985 is being tested and will be merged soon, which will allow a big rewrite of the channel routes (community and about tabs are broken).

IRL stuff is not helping, but we're doing our best!

@B0pol
Copy link
Contributor

B0pol commented Jun 23, 2021

I'm working on it, using youtubei API fixes this issue

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 26, 2021
@unixfox unixfox moved this to Done in Todo - Invidious Jun 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working type:api
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants