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

Ошибка при конвертировании #7

Open
K-a-R-e-N opened this issue Jan 16, 2024 · 6 comments
Open

Ошибка при конвертировании #7

K-a-R-e-N opened this issue Jan 16, 2024 · 6 comments

Comments

@K-a-R-e-N
Copy link

Помогите конвертировать, проблемы не понятные
http://3109117.iptvportal.ru/jtv2.zip

@tataranovich
Copy link
Owner

А какого рода проблема? Падает с ошибкой или неправильно конвертирует?

@K-a-R-e-N
Copy link
Author

K-a-R-e-N commented Jan 23, 2024

А какой-то проблема? Падает с ошибкой или неправильно конвертирует?

Linux spruthub.local 5.15.79-v7+ #1600 SMP Fri Nov 18 18:20:17 GMT 2022 armv7l

pi@spruthub:~ $ git clone https://github.com/tataranovich/jtv2xmltv.git
Cloning into 'jtv2xmltv'...
remote: Enumerating objects: 195, done.
remote: Counting objects: 100% (30/30), done.
remote: Compressing objects: 100% (21/21), done.
remote: Total 195 (delta 10), reused 23 (delta 9), pack-reused 165
Receiving objects: 100% (195/195), 557.59 KiB | 1.35 MiB/s, done.
Resolving deltas: 100% (79/79), done.
pi@spruthub:~ $ cd jtv2xmltv
pi@spruthub:~/jtv2xmltv $ sudo python setup.py install
running install
running bdist_egg
running egg_info
creating jtv2xmltv.egg-info
writing jtv2xmltv.egg-info/PKG-INFO
writing dependency_links to jtv2xmltv.egg-info/dependency_links.txt
writing entry points to jtv2xmltv.egg-info/entry_points.txt
writing top-level names to jtv2xmltv.egg-info/top_level.txt
writing manifest file 'jtv2xmltv.egg-info/SOURCES.txt'
reading manifest file 'jtv2xmltv.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'jtv2xmltv.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-armv7l/egg
running install_lib
running build_py
creating build
creating build/lib
creating build/lib/tests
copying tests/test_utils.py -> build/lib/tests
copying tests/test_convert.py -> build/lib/tests
copying tests/test_parser.py -> build/lib/tests
copying tests/init.py -> build/lib/tests
creating build/lib/jtv2xmltv
copying jtv2xmltv/parser.py -> build/lib/jtv2xmltv
copying jtv2xmltv/utils.py -> build/lib/jtv2xmltv
copying jtv2xmltv/convert.py -> build/lib/jtv2xmltv
copying jtv2xmltv/init.py -> build/lib/jtv2xmltv
copying jtv2xmltv/main.py -> build/lib/jtv2xmltv
creating build/bdist.linux-armv7l
creating build/bdist.linux-armv7l/egg
creating build/bdist.linux-armv7l/egg/tests
copying build/lib/tests/test_utils.py -> build/bdist.linux-armv7l/egg/tests
copying build/lib/tests/test_convert.py -> build/bdist.linux-armv7l/egg/tests
copying build/lib/tests/test_parser.py -> build/bdist.linux-armv7l/egg/tests
copying build/lib/tests/init.py -> build/bdist.linux-armv7l/egg/tests
creating build/bdist.linux-armv7l/egg/jtv2xmltv
copying build/lib/jtv2xmltv/parser.py -> build/bdist.linux-armv7l/egg/jtv2xmltv
copying build/lib/jtv2xmltv/utils.py -> build/bdist.linux-armv7l/egg/jtv2xmltv
copying build/lib/jtv2xmltv/convert.py -> build/bdist.linux-armv7l/egg/jtv2xmltv
copying build/lib/jtv2xmltv/init.py -> build/bdist.linux-armv7l/egg/jtv2xmltv
copying build/lib/jtv2xmltv/main.py -> build/bdist.linux-armv7l/egg/jtv2xmltv
byte-compiling build/bdist.linux-armv7l/egg/tests/test_utils.py to test_utils.cpython-39.pyc
byte-compiling build/bdist.linux-armv7l/egg/tests/test_convert.py to test_convert.cpython-39.pyc
byte-compiling build/bdist.linux-armv7l/egg/tests/test_parser.py to test_parser.cpython-39.pyc
byte-compiling build/bdist.linux-armv7l/egg/tests/init.py to init.cpython-39.pyc
byte-compiling build/bdist.linux-armv7l/egg/jtv2xmltv/parser.py to parser.cpython-39.pyc
byte-compiling build/bdist.linux-armv7l/egg/jtv2xmltv/utils.py to utils.cpython-39.pyc
byte-compiling build/bdist.linux-armv7l/egg/jtv2xmltv/convert.py to convert.cpython-39.pyc
byte-compiling build/bdist.linux-armv7l/egg/jtv2xmltv/init.py to init.cpython-39.pyc
byte-compiling build/bdist.linux-armv7l/egg/jtv2xmltv/main.py to main.cpython-39.pyc
creating build/bdist.linux-armv7l/egg/EGG-INFO
copying jtv2xmltv.egg-info/PKG-INFO -> build/bdist.linux-armv7l/egg/EGG-INFO
copying jtv2xmltv.egg-info/SOURCES.txt -> build/bdist.linux-armv7l/egg/EGG-INFO
copying jtv2xmltv.egg-info/dependency_links.txt -> build/bdist.linux-armv7l/egg/EGG-INFO
copying jtv2xmltv.egg-info/entry_points.txt -> build/bdist.linux-armv7l/egg/EGG-INFO
copying jtv2xmltv.egg-info/top_level.txt -> build/bdist.linux-armv7l/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
tests.pycache.test_convert.cpython-39: module references file
creating dist
creating 'dist/jtv2xmltv-0.2.2-py3.9.egg' and adding 'build/bdist.linux-armv7l/egg' to it
removing 'build/bdist.linux-armv7l/egg' (and everything under it)
Processing jtv2xmltv-0.2.2-py3.9.egg
removing '/usr/local/lib/python3.9/dist-packages/jtv2xmltv-0.2.2-py3.9.egg' (and everything under it)
creating /usr/local/lib/python3.9/dist-packages/jtv2xmltv-0.2.2-py3.9.egg
Extracting jtv2xmltv-0.2.2-py3.9.egg to /usr/local/lib/python3.9/dist-packages
jtv2xmltv 0.2.2 is already the active version in easy-install.pth
Installing jtv2xmltv script to /usr/local/bin

Installed /usr/local/lib/python3.9/dist-packages/jtv2xmltv-0.2.2-py3.9.egg
Processing dependencies for jtv2xmltv==0.2.2
Finished processing dependencies for jtv2xmltv==0.2.2
pi@spruthub:~/jtv2xmltv $ wget http://dkt.iptvportal.ru/jtv.zip
--2024-01-23 14:54:37-- http://dkt.iptvportal.ru/jtv.zip
Resolving dkt.iptvportal.ru (dkt.iptvportal.ru)... 82.202.254.188, 185.137.232.12
Connecting to dkt.iptvportal.ru (dkt.iptvportal.ru)|82.202.254.188|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1360508 (1.3M) [application/zip]
Saving to: ‘jtv.zip’

jtv.zip 100%[=================>] 1.30M 2.07MB/s in 0.6s

2024-01-23 14:54:38 (2.07 MB/s) - ‘jtv.zip’ saved [1360508/1360508]

pi@spruthub:~/jtv2xmltv $ sudo jtv2xmltv -t +0300 -i jtv.zip -o /tmp/tvguide.xml
Failed to parse 110.ndx: 'charmap' codec can't decode byte 0x98 in position 1: character maps to
Failed to parse 150.ndx: 'charmap' codec can't decode byte 0x98 in position 1: character maps to
Failed to parse 160.ndx: 'charmap' codec can't decode byte 0x98 in position 1: character maps to
Failed to parse 165.ndx: 'charmap' codec can't decode byte 0x98 in position 1: character maps to

Failed to parse 3880.ndx: 'charmap' codec can't decode byte 0x98 in position 1: character maps to
Failed to parse 3900.ndx: 'charmap' codec can't decode byte 0x98 in position 1: character maps to
Failed to parse 3905.ndx: 'charmap' codec can't decode byte 0x98 in position 41: character maps to

И без остановки так продолжается пока не надаешь ctrl+c

^CTraceback (most recent call last):
File "/usr/local/bin/jtv2xmltv", line 33, in
sys.exit(load_entry_point('jtv2xmltv==0.2.2', 'console_scripts', 'jtv2xmltv')())
File "/usr/local/lib/python3.9/dist-packages/jtv2xmltv-0.2.2-py3.9.egg/jtv2xmltv/main.py", line 30, in main
xmltv_content = convert_jtv_to_xmltv(jtv_filename, jtv_encoding=jtv_encoding, xmltv_timezone=tz_format)
File "/usr/local/lib/python3.9/dist-packages/jtv2xmltv-0.2.2-py3.9.egg/jtv2xmltv/convert.py", line 48, in convert_jtv_to_xmltv
channel=str(channel_id),
KeyboardInterrupt

@tataranovich
Copy link
Owner

Внутри этого архива кодировка UTF-8. Вот так более-менее сработало у меня:

$ jtv2xmltv -i jtv.zip -o jtv.xml -e UTF-8 -t UTC+3
Failed to parse 1807.ndx: unpack requires a buffer of 8 bytes
Failed to parse 2247.ndx: unpack requires a buffer of 8 bytes
Failed to parse 2248.ndx: unpack requires a buffer of 8 bytes
Failed to parse 3361.ndx: unpack requires a buffer of 8 bytes
Failed to parse 3450.ndx: unpack requires a buffer of 8 bytes
Failed to parse 3730.ndx: unpack requires a buffer of 8 bytes
Failed to parse 5428.ndx: unpack requires a buffer of 8 bytes
Failed to parse 12865.ndx: unpack requires a buffer of 8 bytes

С ошибками вида unpack requires a buffer of 8 bytes нужно разбираться отдельно. Сейчас утилита не умеет декодировать NDX файл если в нём несколько раз сослались на одну и ту же запись в PDT.

@K-a-R-e-N
Copy link
Author

А как быть? Самы можете как то расшифровать указанный файл http://dkt.iptvportal.ru/jtv.zip

@K-a-R-e-N
Copy link
Author

Так как? Можете чем то мне помочь ?

@tataranovich
Copy link
Owner

Так как? Можете чем то мне помочь ?

В ближайшее время я не планирую заниматься этой утилитой, т.к. больше не использую JTV. Попробуйте альтернативные конвертеры или EPG в XMLTV формате.

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

2 participants