justchokingaround / jerry

watch anime with automatic anilist syncing and other cool stuff
GNU General Public License v3.0
291 stars 20 forks source link

[FEATURE] Unicode support, api configuration #8

Closed kopp4 closed 1 year ago

kopp4 commented 1 year ago

I have no clue if this is my problem or not but, jerry seems to not support unicode either in fzf or rofi ? image

Sorry for bothering.

justchokingaround commented 1 year ago

how can i reproduce this bug?

kopp4 commented 1 year ago

I entered my api and here are my config dont know if it helps

use_external_menu=1
discord_presence="true"
# provider="gogoanime"
provider="9anime"
opt_fzf_args="--cycle --reverse"
# subs_language="japanese"
subs_language="english"
video_quality=best

And I entered

jerry -c
justchokingaround commented 1 year ago

could you give me the anime names pls?

justchokingaround commented 1 year ago

(i don't scrape 9anime btw, so it will fallback to zoro)

kopp4 commented 1 year ago

image

Do I post my anilist profile link here? I really have no clue how I could offer the anime names.

justchokingaround commented 1 year ago
curl -s -X POST "https://graphql.anilist.co" \
                -H 'Content-Type: application/json' \
                -H "Authorization: Bearer $(cat ~/.cache/jerry/anilist_token.txt)" \
                -d "{\"query\":\"query(\$userId:Int,\$userName:String,\$type:MediaType){MediaListCollection(userId:\$userId,userName:\$userName,type:\$type){lists{name isCustomList isCompletedList:isSplitCompletedList entries{...mediaListEntry}}user{id name avatar{large}mediaListOptions{scoreFormat rowOrder animeList{sectionOrder customLists splitCompletedSectionByFormat theme}mangaList{sectionOrder customLists splitCompletedSectionByFormat theme}}}}}fragment mediaListEntry on MediaList{id mediaId status score progress progressVolumes repeat priority private hiddenFromStatusLists customLists advancedScores notes updatedAt startedAt{year month day}completedAt{year month day}media{id title{userPreferred romaji english native}coverImage{extraLarge large}type format status(version:2)episodes volumes chapters averageScore popularity isAdult countryOfOrigin genres bannerImage startDate{year month day}}}\",\"variables\":{\"userId\":$(cat ~/.cache/jerry/anilist_user_id.txt),\"type\":\"ANIME\"}}" | tr "\[|\]" "\n" | grep CURRENT > list.txt

can you please run this, and then send me the list.txt file?

justchokingaround commented 1 year ago

ok i see the problem now, it's because i'm using userPreferred instead of english for extracting the title. you could try making a pr to fix it, or i'll push a fix tonight when i come back home

kopp4 commented 1 year ago

I personally don't really understand English title sorry, would you be so kind as to tell me if it's possible to support unicode? And if it does I would like to fix it (if I can)

justchokingaround commented 1 year ago

oh ok, np. i will have to look into it, i remember running into that problem a while ago, and didn't find a solution. i will find one this time dw :+1: (might take some time)

justchokingaround commented 1 year ago

@kopp4 this commit to the unicode-characters: https://github.com/justchokingaround/jerry/commit/e836f8c494d6da78d5854a7d5499910fc58bb025 branch should fix this bug, could you test it out please? if you need help with how to set it up and test i will help np, just ask me

here is my result after i tested locally: image image

kopp4 commented 1 year ago

Yes, it's working perfectly, thank you! image But the problem is ... image Searching in Japanese is not allowed.

justchokingaround commented 1 year ago

https://user-images.githubusercontent.com/44473782/219983062-2c960c3b-c236-4f68-86dd-7dd7ed4fbe17.mp4

you probably just got unlucky timing and zoro changed their encryption keys i guess, because the anime title doesn't affect the search process, only the media id is used

justchokingaround commented 1 year ago

this is from the feat-manga branch

kopp4 commented 1 year ago

you probably just got unlucky timing and zoro changed their encryption keys i guess, because the anime title doesn't affect the search process, only the media id is used

The file is corrupted..

justchokingaround commented 1 year ago

it's only corrupted on phone, you have to download it to be able to see it. i don't know exactly why this happens, i will try to figure it out some day. on a computer it plays fine as well

kopp4 commented 1 year ago

image It's wired, I'll try to figure out what's wrong with it

justchokingaround commented 1 year ago

PLEASE CHECK THAT THE FILE YOU SHARE DOES NOT CONTAIN YOUR ANILIST TOKEN could you please run these 2 commands so i can see some logs for what's happening?

sh -x jerry.sh -c 2> idk.log
echo "$(tail -50 idk.log)" > idk.log

PLEASE CHECK THAT THE FILE YOU SHARE DOES NOT CONTAIN YOUR ANILIST TOKEN

kopp4 commented 1 year ago

Here is idk.log

justchokingaround commented 1 year ago

i need to see the last request being made, could you increase the value for the tail please? still make sure to not accidentally share your token

kopp4 commented 1 year ago

Like this idk.log ?

justchokingaround commented 1 year ago

need just a little bit more. i'm not sure where it starts to break image

justchokingaround commented 1 year ago

this part, where the media_id is first parsed, also interests me, if you could find it :point_right: :point_left: image

justchokingaround commented 1 year ago

oh interesting

kopp4 commented 1 year ago

oh interesting

What that was actually useful?! I just ditched it image

justchokingaround commented 1 year ago

could you try this please? it seems like a problem with consumet's api in your location i guess

sed -i "s/api.consumet.org/api.haikei.xyz/g" jerry.sh
kopp4 commented 1 year ago

Oh it's working now!!!!!!

justchokingaround commented 1 year ago

perfect. in that case i will add an option for the configuration file to use a flexible url for the api host :+1:

kopp4 commented 1 year ago

Thanks a lot bro, really mean it, case closed?

justchokingaround commented 1 year ago

i will close this issue when i merge feat-manga :+1:

justchokingaround commented 1 year ago

perfect. in that case i will add an option for the configuration file to use a flexible url for the api host :+1:

done in https://github.com/justchokingaround/jerry/commit/357117754d79ab1267205d4e4aed7947c39abea3