Giter Site home page Giter Site logo

qnapi / qnapi Goto Github PK

View Code? Open in Web Editor NEW
286.0 15.0 39.0 11.82 MB

Qt-based, multi-engine, multi-platform subtitle downloader

Home Page: http://qnapi.github.io

C++ 94.31% C 0.90% QMake 2.76% NSIS 1.63% Batchfile 0.05% Shell 0.35%
subtitles qt windows linux osx c-plus-plus movie p7zip nsis libmediainfo

qnapi's Introduction

QNapi Build Status Build status GitHub release Github All Releases

QNapi is free software for automatic fetching subtitles for given movie file. It uses online databases such as NapiProjekt, OpenSubtitles and Napisy24. It is based on Qt5 library, so it can be launched on any supported operating system, including Windows, OSX and Linux.

Binary packages

Latest binary packages are available at http://qnapi.github.io/#download

Building from source

Prerequisites

  • C++ compiler with c++11 support installed (clang++, g++ or MinGW for Windows), present in PATH
  • Qt 5.2+ (most recent 5.x recommended) installed with qmake present in PATH (you can find one at http://www.qt.io/download-open-source/)

Binary prerequisites

QNapi requires these binary dependencies:

  • p7zip (7z, 7za) - to unpack subtitles, which are commonly compressed with 7zip
  • libmediainfo - to retrieve movie info such as dimensions, duration and frame rate

Linux/UNIX users can find these dependencies in separate packages.

Statically compiled p7zip binaries are provided in this repository for Windows/OSX users at win32/content/7za.exe and macx/content/7za, respectively. Similarly, compiled libmediainfo libraries are provided for Windows/OSX in deps/libmediainfo/.

WARNING! Precompiled binaries are stripped from the source archive!

Cloning the source code

First, you have to clone project source code using git client:

$ git clone --recursive https://github.com/QNapi/qnapi.git

Compiling

To compile the application, you have to execute two following commands in qnapi root directory:

$ qmake

This will produce Makefile.

By appending CONFIG+=no_cli or CONFIG+=no_gui to qmake invocation you can disable building command-line or graphical interface binaries.

$ make (or mingw32-make on Windows)

This will compile the sources and build executable binary (or app bundle on OSX).

Important! Windows users have to execute one more command:

$ make install (or mingw32-make install)

This one will copy all binaries, libraries and other dependencies to win32/out directory.

Running

By default, output binaries are placed by make in different locations, depending on your operating system:

  • Linux - qnapi in root project directory
  • OSX - macx/QNapi.app bundle
  • Windows - win32/out/qnapi.exe executable

After you locate your binaries, you can run the application.

7zip note

For proper subtitle extraction after download, 7zip executable is required to be passed in application's settings. Linux users have to install 7zip binary package from distribution repositories or compile on its own. For Windows and OSX there are pre-built binaries included in this repository, in win32 and macx directories appropriately and should be automatically detected by the application.

Making redistributable package

OSX

Prerequisites

You need appdmg script installed. You can found it at https://github.com/LinusU/node-appdmg

Building .dmg image

To build .dmg image for OSX with nice, drag&drop installer, you have to execute:

$ make appdmg

QNapi-x.y.z.dmg will appear in macx directory when command is completed.

Windows

Prerequisites

You need to have NSIS 2.x installed. You can found it at http://nsis.sourceforge.net

Also, you will need to manually install NSIS plugin nsProcess. It can be found at http://nsis.sourceforge.net/NsProcess_plugin

Building Windows installer

Installer script is placed at win32/QNapi-setup.nsi. You can build binary exe package using NSIS user interface (by right mouse button -> compile NSIS script) or from command line:

$ C:\Path\To\makensis.exe QNapi-setup.nsi

After a while, QNapi-x.y.z-setup.exe file will appear in win32 directory.

qnapi's People

Contributors

a-sum-duma avatar fisiu avatar kempniu avatar krzemin avatar lgbaldoni avatar luigino avatar michalkrasowski avatar psokol avatar rplociennik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

qnapi's Issues

Nie pobiera napisów zapasowych

Jeżeli mamy ustawione w programie napisy zapasowe i ustawioną opcję przerwania wyszukiwania po znalezieniu pasujących napisów to w przypadku braku napisów PL i zapasowych nie sprawdza już napisów zapasowych w innych serwisach. Nie sprawdza też PL w innych.

Nie wiem jaki jest algorytm w źródle, a okienko szybko znika, ale wygląda na to, że przy tej konfiguracji nie sprawdza w ogóle innych serwisów.

Algorytm jest

  • sprawdź serwis nr 1 PL, jak nie ma to zapasowy język serwis nr 1, jak nie ma to nara

A powinien być

  • sprawdź serwis nr 1 PL, jak nie ma to nr 2 PL, jak nie ma to nr 3 PL, jak nie ma to wraca i od nowa, ale zapasowy np. EN

No przynajmniej mi się tak zdaje.

Window location in multi-screen environment

Hi,

I found a small bug in gui application on windows.
Default window location is 'centered' which does not work as expected if two screens are present.
Window is displayed in the middle of both screens so one half is on the left screen and the other half is on the right.

Thank you,
peku33

Problem z kompilacją qnapi 0.1.8

Mój system operacyjny to Linux Open Suse 13.2 64bit
Pobrałem qnapi

git clone --recursive https://github.com/QNapi/qnapi.git

Doinstalowałem masę brakujących bibliotek i wydałem polecenie

/usr/lib64/qt5/bin/qmake

potem przeprowadziłem kompilację

gienek@linux-ygzy:/Pulpit/qnapi-0.1.8> make
uic ui/frmprogress.ui
uic ui/frmlistsubtitles.ui
uic ui/frmsummary.ui
uic ui/frmscan.ui
uic ui/frmoptions.ui
uic ui/frmabout.ui
uic ui/napiprojekt/frmnapiprojektconfig.ui
uic ui/frmupload.ui
uic ui/frmcorrect.ui
uic ui/frmreport.ui
uic ui/opensubtitles/frmopensubtitlesconfig.ui
compiling src/main.cpp
compiling src/forms/frmprogress.cpp
compiling src/forms/frmlistsubtitles.cpp
compiling src/forms/frmsummary.cpp
compiling src/forms/frmscan.cpp
compiling src/forms/frmoptions.cpp
compiling src/forms/frmabout.cpp
compiling src/forms/frmnapiprojektconfig.cpp
compiling src/forms/frmupload.cpp
compiling src/forms/frmcorrect.cpp
compiling src/forms/frmreport.cpp
compiling src/forms/frmopensubtitlesconfig.cpp
compiling src/qcumber/qmanagedrequest.cpp
compiling src/qcumber/qmanagedsocket.cpp
compiling src/qcumber/qsingleapplication.cpp
compiling src/qnapiconfig.cpp
compiling src/qnapiapp.cpp
compiling src/qnapicli.cpp
compiling src/qnapi.cpp
compiling src/qnapiabstractengine.cpp
compiling src/qnapiprojektengine.cpp
compiling src/qopensubtitlesengine.cpp
compiling src/qmultiparthttprequest.cpp
compiling src/movieinfo.cpp
compiling src/qnapiopendialog.cpp
compiling src/qnapilanguage.cpp
compiling src/qnapisy24engine.cpp
compiling src/synchttp.cpp
compiling src/syncxmlrpc.cpp
compiling src/encodingutils.cpp
compiling deps/libmaia/maiaObject.cpp
compiling deps/libmaia/maiaFault.cpp
compiling deps/libmaia/maiaXmlRpcClient.cpp
compiling deps/libmaia/maiaXmlRpcServer.cpp
compiling deps/libmaia/maiaXmlRpcServerConnection.cpp
compiling src/qcumber/qinterprocesschannel.cpp
rcc res/resources.qrc
compiling tmp/qrc_resources.cpp
moc src/forms/frmprogress.h
compiling tmp/moc_frmprogress.cpp
moc src/forms/frmlistsubtitles.h
compiling tmp/moc_frmlistsubtitles.cpp
moc src/forms/frmsummary.h
compiling tmp/moc_frmsummary.cpp
moc src/forms/frmscan.h
compiling tmp/moc_frmscan.cpp
moc src/forms/frmoptions.h
compiling tmp/moc_frmoptions.cpp
moc src/forms/frmabout.h
compiling tmp/moc_frmabout.cpp
moc src/forms/frmnapiprojektconfig.h
compiling tmp/moc_frmnapiprojektconfig.cpp
moc src/forms/frmupload.h
compiling tmp/moc_frmupload.cpp
moc src/forms/frmcorrect.h
compiling tmp/moc_frmcorrect.cpp
moc src/forms/frmreport.h
compiling tmp/moc_frmreport.cpp
moc src/forms/frmopensubtitlesconfig.h
compiling tmp/moc_frmopensubtitlesconfig.cpp
moc src/qcumber/qmanagedsocket.h
compiling tmp/moc_qmanagedsocket.cpp
moc src/qcumber/qsingleapplication.h
compiling tmp/moc_qsingleapplication.cpp
moc src/qnapiapp.h
compiling tmp/moc_qnapiapp.cpp
moc src/qnapiopendialog.h
compiling tmp/moc_qnapiopendialog.cpp
moc src/qnapilanguage.h
compiling tmp/moc_qnapilanguage.cpp
moc src/qnapithread.h
compiling tmp/moc_qnapithread.cpp
moc src/synchttp.h
compiling tmp/moc_synchttp.cpp
moc src/syncxmlrpc.h
compiling tmp/moc_syncxmlrpc.cpp
moc deps/libmaia/maiaObject.h
compiling tmp/moc_maiaObject.cpp
moc deps/libmaia/maiaFault.h
compiling tmp/moc_maiaFault.cpp
moc deps/libmaia/maiaXmlRpcClient.h
compiling tmp/moc_maiaXmlRpcClient.cpp
moc deps/libmaia/maiaXmlRpcServer.h
compiling tmp/moc_maiaXmlRpcServer.cpp
moc deps/libmaia/maiaXmlRpcServerConnection.h
compiling tmp/moc_maiaXmlRpcServerConnection.cpp
moc src/qcumber/qinterprocesschannel.h
compiling tmp/moc_qinterprocesschannel.cpp
linking qnapi
/usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld: cannot open output file qnapi: Jest katalogiem
collect2: error: ld returned 1 exit status
Makefile:336: polecenia dla obiektu 'qnapi' nie powiodły się
make: *** [qnapi] Błąd 1
gienek@linux-ygzy:
/Pulpit/qnapi-0.1.8>

Szczerze powiedziawszy to ugrzązłem i za bardzo nie wiem jak ruszyć dalej. Czy mógłbyś pomóc mi rozwiązać problem z kompilacją?

Szukam też nieskutecznie wersji Qunapi 0.1.6 rc korzystałem z niej przez wiele lat i kompilowała się u mnie na kolejnych wersjach OpenSuse bez najmniejszego problemu. Niestety w internecie jej już nie znalazłem. Jeśli nie uda mi się zainstalować Qnapi 0.1.8 to może podpowiedziałbyś mi skąd mogę pobrać wersję 0.1.6?

napisy zapasowego języka nie pobierają się w trybie cichym

Kiedy wybieram angielski jako zapasowy język i aktywuje opcję trybu cichego napisy w języku angielskim nie pobierają się (oczywiśnie kiedy nie znajdzie języka polskiego).
Wyłączając tryb cichy i aktywując opcje pokazywania listy wyboru napisów oczywiście znajduje napisy angielskie. Chciałbym jednak, żeby napisy alternatywne ściągały się samodzielnie jeśli nie znajdzie głównego języka.
No i do napisów zapasowych mógłby dodawać się tag (eng/ang) jako opcja.

ps. dzięki za pracę nad QNAPI, program jest znacznie przyjemniejszy i mniej inwazyjny niż napiprojekt.

Zapasowy język napisów nie działa pod OS X

Ustawiłem podstawowy język napisów polski, a zapasowy - angielski. Przy użyciu opcji "pobierz napisy" program nie znajduje żadnych napisów.

Po przestawieniu podstawowego języka na angielski, program znajduje 4 pliki z napisami dla tego samego odcinka serialu. Wydaje się, że powinna to rozwiązać opcja "zapasowy język napisów" i program po niemożliwości ściągnięcia polskiej wersji, ściągnąłby angielską - ale tak się nie dzieje.

SRT converting issue

Heya,

Recently, because of the player I'm using (which doesnt support TXT subtitles), I've enabled converter option.

Overall it works OK, BUT there's too many new line characters added, which is causing issues in my player. I've created a simple python script, which takes care of those characters.

subtitles = open('subtitles.srt', 'r')
content = subtitles.readlines()
subtitles.close()
new_subtitles = open('subtitles_new.srt', 'w')
new_subtitles.write('\n'.join([x.strip() for x in content if x.strip()]))
new_subtitles.close()

After running those couple of lines, the subtitles are working fine with my player.

Any chance that this can be fixed in the core?

Thanks for this software!

Regards,
Kacper.

Silent/quiet mode

Another feature request :-)

silent - just download subtitles and do not open any windows (perfect if you get subtitles just before launching movie)

quiet - much harder to implement cross platform - some kind of timed self closing pop-up (it should stay if failed)

Dalsze problemy z pobieraniem napisów (Napisy24?)

Nadal nie działa pobieranie odnośnie #46, tamta poprawka na pewno poprawiła omyłkowy brak w kodzie, ale jest inny problem.

Jak ustawię Napisy24 na pierwszej pozycji, a napi na drugiej to nie pobiera mi nic, a na obu serwisach są napisy pl do serialu na którym to testuje.

Mimo, że okienko m.in. wypisuje "rozpakowywanie" itp.

Gdy zamienię kolejność na napi, a potem napisy24 to działa.

Ba, jak włączę zawsze pokazywanie listy napisów to są na obu serwisach, czyli je znajduje, ale i tak nic nie zapisuje, jeżeli wybiorę te z napisy24, na końcu i tak będzie nie pobrano napisów.

Wygląda na to, że z obsługą napisy24 coś nie gra.

Dodatkowo tylko w jednym przypadku podświetla mi na zielono napis z listy (testuje na 3 odcinkach serialu), może warto się temu też przyjrzeć albo to może pomóc w diagnozie.

Sprawdziłem nawet snifferem, napisy24 zwraca, że jest ok i są napisy, no, ale w programie rezultaty takie jak opisałem. Sprawdziłbym lepiej debbugerem, ale nie chce mi ruszyć.

Enabling conversion options breaks encoding (Linux, 0.1.9, x64)

Mostly i download subtitles in win1250. But sometimes files are in UTF-8 so i want to be sure that i've final subtitles in win1250. So i enable after enabling conversion options and selecting converting to win1250. But every subtitle after such conversion is gibberish. enca (Linux tool to check file charset) says final file is in UTF-8 but it isn't. It's some strange encoding.

Proposal: option to find subtitles by filename

I'd love to have an option to search for subtitles using the filename (as a last resort fallback). Why? I often transcode or download already transcoded files, and so the file checksum is different but I know that there are already subtitles that match my version of the movie / tv series. I then have to find subtitles with old ways, but I'd rather have QNapi find them for me (especially because it has the subtitles transformation options and it can scan whole sets of folders). Is it possible to be added as an option?

Subtitle downloading problem (Linux, 0.2.0, x64)

Subtitles are not downloaded when i switch on file conversion. With this set to off downloading works ok. When it's enabled i get dialogs about selecting one of many available subtitles but finally no subtitle file is created in directory.

Folder scanning improvements

Scenario:

I am scanning a folder with 50 movies.
Every time Qnapi finds the subtitles, shows a popup box with choices what to do.

Improvement:
When the scan is finished, one single result window could be shown to choose operations per movie.

Opcja wyboru języka

Czy jest możliwe dodanie opcji, żeby w oknie wyboru napisów do ściągnięcia wyświetlały się napisy i w języku podstawowym i zapasowym ?

Chodzi o to, że czasami człowiek musi popróbować różnych napisów, żeby trafić w te które pasują. Czasami (bardzo sporadycznie), żadne z podstawowych napisów nie są satysfakcjonujące. Wtedy trzeba wejść do opcji i zamienić ze sobą języki. A taka opcja rozwiązywała by ten problem.

OS X 10.11 menubar icon

Po aktywacji opcji autoukrywania paska menu ikona Qnapi nie jest widoczna - w jej miejscu widoczna jest pusta przestrzeń, po której kliknięciu dostępne jest standardowe menu podręczne.
Ta pusta przestrzeń pojawia się czasami miedzy widocznymi już ikonami lub też jako pierwsza od lewej (przed innymi ikonami w pasku menu).

[OS X] Wsparcie dla wyświetlaczy Retina

Cześć.

Czy będzie dodane wsparcie dla wyświetlaczy Retina? Aktualnie program wyświetla trochę "pikselozę" - nie ostre są okienka programów :)

Dowody w postaci zrzutów ekranów:
zrzut 1
zrzut 2
Pozdrawiam twórców :)

Multi language subtitles download

I quess it would be nice to download more than one subtitles language version.
For example if there are no subtitles yet for language A I have to change in options to dowload English subtitles.
So dear DEVS if you just can think to add the option to dowload subtitles in addtional language version if there are no subtitles in default language that would be great.

BTW:
Great job!!

Język pobranych napisów w oknie podsumowania

Jakiś czas temu dodałem sobie takie coś do źródełek, w podsumowaniu pobranych napisów mam po ikonie język pobranych napisów w formacie [xx] gdzie xx to PL lub w moim przypadku EN, zależy co było.

Nie mogę z tego zrobić PR, a i nie wiem czy to tak powinno być rozwiązane, ale zgłaszam to jako propozycję.

Ja zmieniłem listę gotList w frmprogress na listę QPair => QString,QString

Co wymagało też zmiany w frmSummary::setSummaryList

Para ta przekazuje to co wcześniej czyli link do pliku oraz symbol języka pl lub np. en.

Jako, że program dwustopniowo sprawdza napisy, najpierw podstawowe potem dodatkowe dodałem sobie zmienną foundBackup by wiedzieć, że znalezione napisy są w języku zapasowym.

Tak potem dodaje do listy gotList.append(qMakePair(queue[i], foundBackup ? languageBackup : language));

A w setSummaryList musiałem zrobić tak

QPair<QString, QString> successItem;
foreach(successItem, listSuccess)
{
QListWidgetItem* wi = new QListWidgetItem(succIcon,"[" + successItem.second.toUpper() + "] " + QFileInfo(successItem.first).fileName());
ui.lwSummary->addItem(wi);
}

Tak tylko podaję jak ja to ogarnąłem, może się przyda. Pisałem pod kątem sytuacji wyboru języka dodatkowego, bo jak ktoś ściąga tylko PL to mu się ta opcja zbytnio nie przyda.

Tray icon vs main window interface

There are some problems with tray icon based interface.

  • as described here #17, tray-based GUIs do not work well in Unity environments unless is compiled against Qt 5.5
  • many users reported that after launching qnapi nothing happens - they probably expect a window to appear, but only small icon were added to a system tray, which could be easily unnoticed

I wonder on a real change here. The most promising and obvious alternative is a main window, with all options available from standard application menus and drag&drop area, where you can drop file/directory to begin subtitle downloading (or directory scanning).

Wouldn't it be easier for an ordinary user? Or both interfaces should be supported and the choice left to user (via settings)?
What do you think about this idea?

Always returns exit code 0 in CLI mode

Regards Linux OS.
Returns 0 even if the subtitles were unavailable.
Different exit codes could be useful for scripting.

User story:

  1. Try to download subs for non-existent movie:
    $ qnapi -c movie.avi &> /dev/null && echo ok || echo no
  2. Script returns
    no

Immediate crash after startup

App crashed started from installer. Using latest Win 8.1 with all updates. Kaspersky AV + Malwarebytes Anti-Malware was running in background.

Problem signature:
Problem Event Name: APPCRASH
Application Name: qnapi.exe
Application Version: 0.0.0.0
Application Timestamp: 00250c60
Fault Module Name: libgcc_s_dw2-1.dll
Fault Module Version: 6.3.9600.17736
Fault Module Timestamp: 550f42c2
Exception Code: c0000135
Exception Offset: 0009d4f2
OS Version: 6.3.9600.2.0.0.256.48
Locale ID: 1045
Additional Information 1: 1abe
Additional Information 2: 1abee00edb3fc1158f9ad6f44f0f6be8
Additional Information 3: 1abe
Additional Information 4: 1abee00edb3fc1158f9ad6f44f0f6be8

Freeze if results window open

0.1.6-rc2 freezes after sub download request if result window of a previous subs download wasn't closed.

Reproduction steps:

  1. download some subs
  2. don't close the results
  3. try to download another subs

*.srt files ignored during folder scan

When folder scan option is used ("Skanuj katalogi") and ignoring files with subtitles present ("Podczas wyszukiwania pomijaj pliki, do których istnieją już napisy") is ON, QNapi ignores existing *.srt files (only *.txt files are detected).

Issue is present in QNapi 0.1.9-snapshot and previous versions.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.