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

Languages #1

Open
blal1 opened this issue Feb 28, 2023 · 8 comments
Open

Languages #1

blal1 opened this issue Feb 28, 2023 · 8 comments

Comments

@blal1
Copy link

blal1 commented Feb 28, 2023

Hi
When I have added this parameter request_locale=fr to download the french cards I got only the packs names in french but the cards still in English. How can I got them in french? Thanks

@Pietracoops
Copy link
Owner

Pietracoops commented Feb 28, 2023 via email

@Pietracoops
Copy link
Owner

New branch has been created called experimental-language. Checkout this branch and call the script as instructed in the readme.md file. Use the parameter "--language fr". I'm still running tests, and working out some of the code - though give it a try, and if you run into any issues list them here and I'll tackle them.

@blal1
Copy link
Author

blal1 commented Mar 1, 2023

Hi,
Thanks for your work
Now, the scraper works correctly and I can download the french cards without any problems
For the wiki, the url is different then the English's

https://yugioh.fandom.com/fr/wiki/Wiki_Yu-Gi-Oh!
That is the french Ygo wiki
So, sorry about my English

@Pietracoops
Copy link
Owner

No problem, I also speak french so you can send me emails in french if it makes it easier.

I pushed some more changes this morning as I noticed the script was crashing on card sets that were not fully released just yet (Maze of Memories - march 10th release), so if you run into that issue, pull from the branch.

Also, I've been playing around with the languages on fandom and noticed that they dont have multilingual card pages (e.g. https://yugioh.fandom.com/wiki/Flame_Manipulator -> https://yugioh.fandom.com/fr/wiki/Flame_Manipulator - this doesn't work). So there is still work to be done on this and will only be available in english for now.

@blal1
Copy link
Author

blal1 commented Mar 4, 2023

Hello,
I tested the program and encountered a bug. When he downloads the French cards and when he downloads the 144th pack, he displays the following errors before exiting the program.
Packs Processed |█████████▏⚠︎ | (!) 144/632 [23%] in 2:32.5 (0.95/s)
Traceback (most recent call last):
File "C:\yugioh_cardlist_scraper-experimental-language\yugioh_cardlist_scraper-experimental-language\main.py", line 94, in
if detect(english_name) != 'en':
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Eleve\AppData\Local\Programs\Python\Python311\Lib\site-packages\langdetect\detector_factory.py", line 130, in detect
return detector.detect()
^^^^^^^^^^^^^^^^^
File "C:\Users\Eleve\AppData\Local\Programs\Python\Python311\Lib\site-packages\langdetect\detector.py", line 136, in detect
probabilities = self.get_probabilities()
^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Eleve\AppData\Local\Programs\Python\Python311\Lib\site-packages\langdetect\detector.py", line 143, in get_probabilities
self._detect_block()
File "C:\Users\Eleve\AppData\Local\Programs\Python\Python311\Lib\site-packages\langdetect\detector.py", line 150, in _detect_block
raise LangDetectException(ErrorCode.CantDetectError, 'No features in text.')
langdetect.lang_detect_exception.LangDetectException: No features in text.

C:\Users\Eleve>Python C:\yugioh_cardlist_scraper-experimental-language\yugioh_cardlist_scraper-experimental-language\main.py --language fr

@blal1
Copy link
Author

blal1 commented Mar 11, 2023

Hello!
Sorry for inconvenience,
I tested the programm with experimental languages. But when I'm trying to download the french packs I got the following errors. Especially, when he's trying to download the 144th pack. After that, the programm doesn't continue with downloding the next packs.
The following lines are the errors.

Packs Processed |█████████▏⚠︎ | (!) 144/634 [23%] in 2:25.8 (0.99/s)
Traceback (most recent call last):
File "C:\ygo\ygo\main.py", line 94, in
if detect(english_name) != 'en':
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Bil\AppData\Local\Programs\Python\Python311\Lib\site-packages\langdetect\detector_factory.py", line 130, in detect
return detector.detect()
^^^^^^^^^^^^^^^^^
File "C:\Users\Bil\AppData\Local\Programs\Python\Python311\Lib\site-packages\langdetect\detector.py", line 136, in detect
probabilities = self.get_probabilities()
^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Bil\AppData\Local\Programs\Python\Python311\Lib\site-packages\langdetect\detector.py", line 143, in get_probabilities
self._detect_block()
File "C:\Users\Eleve\AppData\Local\Programs\Python\Python311\Lib\site-packages\langdetect\detector.py", line 150, in _detect_block
raise LangDetectException(ErrorCode.CantDetectError, 'No features in text.')
langdetect.lang_detect_exception.LangDetectException: No features in text.

Thanks,

@Pietracoops
Copy link
Owner

Try pulling the latest changes, it should resolve that issue! It had to do with a feature that I tried to implement to catch certain Japanese edge cases - though when it encounters a card that is simply "7", it fails to find enough features to detect what language it is.

@enamespace
Copy link

Hi, I want to download Chinese version cards, but it seems not supported for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants