mirror of
https://github.com/Alexander-D-Karpov/akarpov
synced 2024-11-22 00:26:36 +03:00
fixed translator error
This commit is contained in:
parent
0fa2d34e2f
commit
c6063942c2
|
@ -2,7 +2,11 @@
|
|||
import re
|
||||
|
||||
import requests
|
||||
from deep_translator import GoogleTranslator
|
||||
|
||||
try:
|
||||
from deep_translator import GoogleTranslator # TODO: move to another service
|
||||
except requests.exceptions.JSONDecodeError:
|
||||
print("Failed to initialize GoogleTranslator due to external API issues.")
|
||||
from django.core.files import File
|
||||
from django.db import transaction
|
||||
from django.utils.text import slugify
|
||||
|
|
|
@ -3,7 +3,11 @@
|
|||
|
||||
import requests
|
||||
import spotipy
|
||||
|
||||
try:
|
||||
from deep_translator import GoogleTranslator
|
||||
except requests.exceptions.JSONDecodeError:
|
||||
print("Failed to initialize GoogleTranslator due to external API issues.")
|
||||
from django.conf import settings
|
||||
from django.core.files import File
|
||||
from django.db import transaction
|
||||
|
|
Loading…
Reference in New Issue
Block a user