From a1ece70ffc585241e4ea552f0d8b10c8ae5fa0b8 Mon Sep 17 00:00:00 2001 From: Jakob Haufe Date: Thu, 12 Jun 2014 21:15:57 +0200 Subject: [PATCH] Imported Upstream version 2.1.5 --- CHANGES | 14 +++ empty.ts | 53 ++++----- locale/ar.ts | 24 ++-- locale/ast.ts | 2 +- locale/ca.ts | 198 ++++++++++++++++----------------- locale/da.ts | 2 +- locale/es.ts | 26 ++--- locale/es_ES.ts | 2 +- locale/fi.ts | 2 +- locale/fi_FI.ts | 2 +- locale/fr.ts | 2 +- locale/gl.ts | 2 +- locale/ky.ts | 4 +- locale/locale.pri | 2 +- locale/ms_MY.ts | 2 +- locale/nb.ts | 2 +- locale/nl.ts | 2 +- locale/pl.ts | 2 +- locale/ru.ts | 6 +- locale/sk.ts | 2 +- locale/sl.ts | 40 +++---- locale/sv_SE.ts | 210 +++++++++++++++++------------------ locale/tr.ts | 2 +- locale/uk.ts | 172 ++++++++++++++-------------- locale/uk_UA.ts | 172 ++++++++++++++-------------- locale/zh_CN.ts | 2 +- locale/zh_TW.ts | 2 +- minitube.desktop | 4 +- minitube.pro | 7 +- src/aboutview.cpp | 4 +- src/diskcache.cpp | 3 +- src/loadingwidget.cpp | 3 +- src/main.cpp | 6 + src/mainwindow.h | 1 - src/playlistitemdelegate.cpp | 21 ++++ src/searchview.cpp | 10 +- src/video.cpp | 90 +++++++++++++-- src/video.h | 9 +- 38 files changed, 620 insertions(+), 489 deletions(-) diff --git a/CHANGES b/CHANGES index 8d9e128..f2ac1c5 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,17 @@ +2.1.5 +- Fix some videos not playing +- Show video title on hover when playlist is in minimode (thumbs only) +- Lighter font for video title and description on Mac & Ubuntu + +2.1.4 +- Fixed fonts in Mac OS X Mavericks +- Fixed "busy" mouse cursor at launch on Ubuntu +- Updated translations + +2.1.3 +- Fixed video seeking +- New and updated translations + 2.1.2 - Downloads only enabled on Creative Commons licensed videos - Fixed playback of some videos diff --git a/empty.ts b/empty.ts index 8d4ee7a..af6d5d9 100644 --- a/empty.ts +++ b/empty.ts @@ -107,7 +107,8 @@ - The full version allows you to download videos longer than %1 minutes and to watch videos without interruptions. + The full version allows you to watch videos without interruptions. + The full version allows you to download videos longer than %1 minutes and to watch videos without interruptions. @@ -501,13 +502,13 @@ - + &Pause - + Pause playback @@ -628,7 +629,7 @@ - + &Downloads @@ -753,58 +754,58 @@ - + Press %1 to raise the volume, %2 to lower it - - + + Opening %1 - + Do you want to exit %1 with a download in progress? - + If you close %1 now, this download will be cancelled. - + Close and cancel download - + Wait for download to finish - + Leave &Full Screen - + %1 version %2 is now available. - + Remind me later - + Update - + Error: %1 @@ -864,52 +865,52 @@ - + Choose your content location - + &Play - + Resume playback - + Remaining time: %1 - + Volume at %1% - + Volume is muted - + Volume is unmuted - + Maximum video definition set to %1 - + Your privacy is now safe - + Downloads complete diff --git a/locale/ar.ts b/locale/ar.ts index 512eba2..61cbbce 100644 --- a/locale/ar.ts +++ b/locale/ar.ts @@ -139,7 +139,7 @@ By %1 - + بواسطة %1 @@ -165,32 +165,32 @@ Mark all as watched - + علّمها كمُشاهدة Show Updated - + أظهر التّحديثات Name - + الاسم Last Updated - + آخر تحديث Last Added - + آخر إضافة Last Watched - + آخر عرض @@ -215,7 +215,7 @@ There are no updated subscriptions at this time. - + لا يوجد تحديثات لقوائم اشتراكاتك حاليًا @@ -455,7 +455,7 @@ Channel subscriptions - + اشتراكات القنوات @@ -704,7 +704,7 @@ Open in &Browser... - + افتح &ضمن المُستعرض... @@ -966,7 +966,7 @@ Unsubscribe from %1 - + إلغاء الاشتراك من %1 @@ -1333,7 +1333,7 @@ All Time Popular - + مشهورة دومًا diff --git a/locale/ast.ts b/locale/ast.ts index 41432e7..e8a0faa 100644 --- a/locale/ast.ts +++ b/locale/ast.ts @@ -200,7 +200,7 @@ Sort by - + Ordenar por diff --git a/locale/ca.ts b/locale/ca.ts index f91f7ef..cfbb102 100644 --- a/locale/ca.ts +++ b/locale/ca.ts @@ -106,7 +106,7 @@ The full version allows you to download videos longer than %1 minutes and to watch videos without interruptions. - + La versió completa permet descarregar vídeos de més de %1 minuts i veure els vídeos sense interrupcions. @@ -139,7 +139,7 @@ By %1 - + Per %1 @@ -152,12 +152,12 @@ All Videos - + Tots els vídeos Unwatched Videos - + Vídeos no vists @@ -165,37 +165,37 @@ Mark all as watched - + Marca-ho tot vist Show Updated - + Mostra actualitzats Name - + Nom Last Updated - + Últim actualitzat Last Added - + Últim afegit Last Watched - + Últim vist Most Watched - + Més vistos @@ -205,22 +205,22 @@ All Videos - + Tots els vídeos Unwatched Videos - + Vídeos no vistos There are no updated subscriptions at this time. - + No hi han subscripcions actualitzades. You have no subscriptions. Use the star symbol to subscribe to channels. - + No teniu subscripcions. Feu servir el símbol de l'estrella per subscríure-us als canals. @@ -435,32 +435,32 @@ Find videos and channels by keyword - + Troba vídeos i canals per paraula clau Browse - + Explora Browse videos by category - + Explora vídeos per categoria Subscriptions - + Subscripcions Channel subscriptions - + Subscripcions de canal Make yourself comfortable - + Poseu-vos còmodes @@ -644,7 +644,7 @@ &Subscribe to Channel - + &Subscriu al canal @@ -689,22 +689,22 @@ More... - + Més... &Related Videos - + Vídeos &Relacionats Watch videos related to the current one - + Visualitza vídeos relacionats amb l'actual Open in &Browser... - + Obre al &Navegador... @@ -860,7 +860,7 @@ Choose your content location - + Esculliu la ubicació del vostre contingut @@ -966,12 +966,12 @@ Unsubscribe from %1 - + Cancel·la la subscripció a %1 Subscribe to %1 - + Subscriu-me a %1 @@ -994,7 +994,7 @@ %1 %2 is now available. You have %3. - %1 %2 estan disponibles. Tu tens %3. + %1 %2 està disponible. Tu tens %3. @@ -1014,7 +1014,7 @@ Install Update - Instal·la Actualització + Instal·la l'actualització @@ -1022,7 +1022,7 @@ Paste - Enganxar + Enganxa @@ -1035,47 +1035,47 @@ %1 of %2 (%3) — %4 - + %1 de %2 (%3) — %4 Preparing - + Preparant Failed - + Fallit Completed - + Completat Stopped - + Aturat Stop downloading - + Atura la baixada Show in %1 - + Mostra en %1 Open parent folder - + Obre el directori superior Restart downloading - + Recomença la baixada @@ -1083,12 +1083,12 @@ Searching... - Buscant... + Cercant... Show %1 More - + Mostra %1 Més @@ -1216,7 +1216,7 @@ Done - + Fet @@ -1287,12 +1287,12 @@ Forward to %1 - + Avança a %1 Back to %1 - + Retrocedeix a %1 @@ -1313,27 +1313,27 @@ Most Popular - + Més popular Most Shared - + Més compartit Most Discussed - + Més comentat Top Rated - + Millor valorats All Time Popular - + Populars de sempre @@ -1354,242 +1354,242 @@ Algeria - + Algèria Argentina - + Argentina Australia - + Austràlia Belgium - + Bèlgica Brazil - + Brazil Canada - + Canadà Chile - + Xile Colombia - + Colòmbia Czech Republic - + República Txeca Egypt - + Egipte France - + França Germany - + Alemanya Ghana - + Ghana Greece - + Grècia Hong Kong - + Hong Kong Hungary - + Hongria India - + Índia Indonesia - + Indonèsia Ireland - + Irlanda Israel - + Israel Italy - + Itàlia Japan - + Japó Jordan - + Jordània Kenya - + Kenya Malaysia - + Malàisia Mexico - + Mèxic Morocco - + Marroc Netherlands - + Holanda New Zealand - + Nova Zelanda Nigeria - + Nigèria Peru - + Perú Philippines - + Filipines Poland - + Polònia Russia - + Rússia Saudi Arabia - + Aràbia Saudita Singapore - + Singapur South Africa - + Sud-àfrica South Korea - + Corea del Sud Spain - + Espanya Sweden - + Suècia Taiwan - + Taiwan Tunisia - + Tunísia Turkey - + Turquia Uganda - + Uganda United Arab Emirates - + Emirats Àrabs Units United Kingdom - + Regne Unit Yemen - + Yemen Worldwide - + Global \ No newline at end of file diff --git a/locale/da.ts b/locale/da.ts index 7cfebf4..0340ea0 100644 --- a/locale/da.ts +++ b/locale/da.ts @@ -704,7 +704,7 @@ Open in &Browser... - + Åbn i &browser... diff --git a/locale/es.ts b/locale/es.ts index e41b87c..9ded3ba 100644 --- a/locale/es.ts +++ b/locale/es.ts @@ -70,7 +70,7 @@ What you always wanted to know about %1 and never dared to ask - Lo que siempre quiso saber acerca de %1 y nunca se atrevió a preguntar + Lo que siempre quisiste saber acerca de %1 y nunca te atreviste a preguntar @@ -251,17 +251,17 @@ bytes/sec - bytes/s + bytes/seg KB/sec - KB/s + KB/seg MB/sec - MB/s + MB/seg @@ -276,7 +276,7 @@ %4 %5 remaining - Quedan %4 %5 + %4 %5 restantes @@ -377,7 +377,7 @@ Play/Pause - Reproducir/pausar + Reproducir/Pausar @@ -508,7 +508,7 @@ &Full Screen - Pantalla &completa + &Pantalla Completa @@ -528,7 +528,7 @@ Copy the current video YouTube link to the clipboard - Copiar el enlace a YouTube del vídeo actual en el portapapeles + Copiar el enlace de YouTube del vídeo actual en el portapapeles @@ -588,7 +588,7 @@ &Website - Sitio &web + &Sitio web @@ -598,7 +598,7 @@ Please support the continued development of %1 - Apoye el desarrollo continuo de %1 + Porfavor apoye el desarrollo continuo de %1 @@ -618,7 +618,7 @@ Mute volume - Silenciar + Silenciar volumen @@ -704,7 +704,7 @@ Open in &Browser... - + Abrir en &Navegador... @@ -744,7 +744,7 @@ &Help - Ay&uda + &Ayuda diff --git a/locale/es_ES.ts b/locale/es_ES.ts index 7d67e71..52227c2 100644 --- a/locale/es_ES.ts +++ b/locale/es_ES.ts @@ -175,7 +175,7 @@ Name - + Nombre diff --git a/locale/fi.ts b/locale/fi.ts index 73066cc..cf0338e 100644 --- a/locale/fi.ts +++ b/locale/fi.ts @@ -704,7 +704,7 @@ Open in &Browser... - + Avaa &selaimessa... diff --git a/locale/fi_FI.ts b/locale/fi_FI.ts index dcc2ebc..5064e7e 100644 --- a/locale/fi_FI.ts +++ b/locale/fi_FI.ts @@ -704,7 +704,7 @@ Open in &Browser... - + Avaa &selaimessa... diff --git a/locale/fr.ts b/locale/fr.ts index 925b5e9..88396ed 100644 --- a/locale/fr.ts +++ b/locale/fr.ts @@ -704,7 +704,7 @@ Open in &Browser... - + Ouvrir dans le &navigateur ... diff --git a/locale/gl.ts b/locale/gl.ts index 3b60606..fe747fc 100644 --- a/locale/gl.ts +++ b/locale/gl.ts @@ -705,7 +705,7 @@ Open in &Browser... - + Abrir no &navegador diff --git a/locale/ky.ts b/locale/ky.ts index 14aa41b..8ebede6 100644 --- a/locale/ky.ts +++ b/locale/ky.ts @@ -704,7 +704,7 @@ Open in &Browser... - + &Браузерден ачуу... @@ -971,7 +971,7 @@ Subscribe to %1 - + %1 каналына жазылуу diff --git a/locale/locale.pri b/locale/locale.pri index 60568a8..925d63a 100644 --- a/locale/locale.pri +++ b/locale/locale.pri @@ -4,7 +4,7 @@ INCLUDEPATH += $$PWD DEPENDPATH += $$PWD # ls -1 *.ts | tr '\n' ' ' -TRANSLATIONS += ar.ts ast.ts bg_BG.ts ca.ts cs_CZ.ts da.ts de_DE.ts el.ts en.ts es.ts es_AR.ts es_ES.ts fi.ts fi_FI.ts fr.ts gl.ts he_IL.ts hu.ts ia.ts it.ts ja_JP.ts ky.ts ms_MY.ts nb.ts nl.ts pl.ts pl_PL.ts pt_BR.ts ro.ts ru.ts sk.ts sl.ts sq.ts sv_SE.ts tr.ts uk.ts uk_UA.ts zh_CN.ts zh_TW.ts +TRANSLATIONS += ar.ts ast.ts be.ts bg_BG.ts ca.ts ca_ES.ts cs_CZ.ts da.ts de_DE.ts el.ts en.ts es.ts es_AR.ts es_ES.ts es_MX.ts fi.ts fi_FI.ts fr.ts gl.ts he_IL.ts hr.ts hu.ts ia.ts it.ts ja_JP.ts ky.ts ms_MY.ts nb.ts nl.ts pl.ts pl_PL.ts pt.ts pt_BR.ts ro.ts ru.ts sk.ts sl.ts sq.ts sv_SE.ts tr.ts uk.ts uk_UA.ts vi.ts zh_CN.ts zh_TW.ts isEmpty(QMAKE_LRELEASE) { win32:QMAKE_LRELEASE = $$[QT_INSTALL_BINS]\lrelease.exe else:QMAKE_LRELEASE = $$[QT_INSTALL_BINS]/lrelease diff --git a/locale/ms_MY.ts b/locale/ms_MY.ts index e46ffa3..ea9444c 100644 --- a/locale/ms_MY.ts +++ b/locale/ms_MY.ts @@ -704,7 +704,7 @@ Open in &Browser... - + Buka dalam Pela&yar... diff --git a/locale/nb.ts b/locale/nb.ts index a91f6f3..f458020 100644 --- a/locale/nb.ts +++ b/locale/nb.ts @@ -200,7 +200,7 @@ Sort by - + Sorter etter diff --git a/locale/nl.ts b/locale/nl.ts index 8643c3b..bfffca0 100644 --- a/locale/nl.ts +++ b/locale/nl.ts @@ -704,7 +704,7 @@ Open in &Browser... - + Open in &browser... diff --git a/locale/pl.ts b/locale/pl.ts index f337bae..968f390 100644 --- a/locale/pl.ts +++ b/locale/pl.ts @@ -175,7 +175,7 @@ Name - + Nazwa diff --git a/locale/ru.ts b/locale/ru.ts index 2d5b2a8..8b50417 100644 --- a/locale/ru.ts +++ b/locale/ru.ts @@ -221,7 +221,7 @@ You have no subscriptions. Use the star symbol to subscribe to channels. - У вас нед подписок. Используйте символ звездочки чтобы подпываться на каналы. + У вас нет подписок. Используйте символ звездочки чтобы подписаться на каналы. @@ -705,7 +705,7 @@ Open in &Browser... - + Открыть в &браузере... @@ -1319,7 +1319,7 @@ Most Shared - + Чаще делились diff --git a/locale/sk.ts b/locale/sk.ts index d5edd17..0c7bce3 100644 --- a/locale/sk.ts +++ b/locale/sk.ts @@ -704,7 +704,7 @@ Open in &Browser... - + Otvoriť v prehliadači... diff --git a/locale/sl.ts b/locale/sl.ts index 29c9921..a4fc376 100644 --- a/locale/sl.ts +++ b/locale/sl.ts @@ -88,7 +88,7 @@ &Code: - + &Koda: @@ -131,7 +131,7 @@ Buy License - Kupi licenco + Kupite licenco @@ -359,7 +359,7 @@ Downloading update... - Prenos posodobitve... + Prenos posodobitve ... @@ -440,7 +440,7 @@ Browse - + Brskaj @@ -450,17 +450,17 @@ Subscriptions - + Naročnine Channel subscriptions - + Naročanje kanalov Make yourself comfortable - + Udobno se namestite @@ -689,7 +689,7 @@ More... - Več... + Več ... @@ -704,7 +704,7 @@ Open in &Browser... - + Odpri v &Brskalniku... @@ -971,7 +971,7 @@ Subscribe to %1 - + Naroči se na %1 @@ -1014,7 +1014,7 @@ Install Update - + Namesti posodobitev @@ -1022,7 +1022,7 @@ Paste - + Prilepi @@ -1035,12 +1035,12 @@ %1 of %2 (%3) — %4 - + %1 od %2 (%3) — %4 Preparing - + V pripravi @@ -1282,7 +1282,7 @@ &Back - + Na&zaj @@ -1313,12 +1313,12 @@ Most Popular - + Najbolj popularno Most Shared - + Najbolj deljeno @@ -1328,7 +1328,7 @@ Top Rated - + Najbolje ocenjeno @@ -1529,7 +1529,7 @@ Singapore - + Singapur @@ -1579,7 +1579,7 @@ United Kingdom - Velika Britanija + Združeno kraljestvo diff --git a/locale/sv_SE.ts b/locale/sv_SE.ts index 24a500a..e721753 100644 --- a/locale/sv_SE.ts +++ b/locale/sv_SE.ts @@ -78,7 +78,7 @@ Enter your License Details - + Ange dina Licens Detaljer @@ -106,12 +106,12 @@ The full version allows you to download videos longer than %1 minutes and to watch videos without interruptions. - + Fullversionen tillåter dig att ladda ner videor längre än %1 minut och att se på videor utan avbrott. Without a license, the application will expire in %1 days. - + Utan en licens, kommer programmet att upphöra inom %1 dag. @@ -126,7 +126,7 @@ Enter License - + Ange Licens @@ -139,7 +139,7 @@ By %1 - + Av %1 @@ -152,12 +152,12 @@ All Videos - + Alla Videor Unwatched Videos - + Osedda Videor @@ -165,12 +165,12 @@ Mark all as watched - + Markera alla som sedda Show Updated - + Visa Uppdaterat @@ -180,47 +180,47 @@ Last Updated - + Senast Uppdaterad Last Added - + Senast Tillagda Last Watched - + Senast Sedda Most Watched - + Mest Sedda Sort by - + Sortera enligt All Videos - + Alla Videor Unwatched Videos - + Osedda Videor There are no updated subscriptions at this time. - + Det finns inga uppdaterade prenumerationer just nu. You have no subscriptions. Use the star symbol to subscribe to channels. - + Du har inga prenumerationer. Använd stjärnsymbolen för att prenumerera på kanaler. @@ -304,12 +304,12 @@ %1 downloaded in %2 - + %1 nerladdad i %2 Download finished - + Nerladdning klar @@ -359,7 +359,7 @@ Downloading update... - + Laddar ner uppdatering... @@ -435,32 +435,32 @@ Find videos and channels by keyword - + Hitta videor och kanaler genom ett nyckelord Browse - + Sök Browse videos by category - + Sök videor enligt kategori Subscriptions - + Prenumerationer Channel subscriptions - + Kanal prenumerationer Make yourself comfortable - + Gör det bekvämt för dig @@ -644,7 +644,7 @@ &Subscribe to Channel - + %Prenumerera på Kanalen @@ -679,12 +679,12 @@ &Report an Issue... - + &Rapportera ett problem... &Refine Search... - + &Förfinad sökning... @@ -694,17 +694,17 @@ &Related Videos - + &Relaterade Videor Watch videos related to the current one - + Visa videor relaterade till den nuvarande Open in &Browser... - + Öppna i &Webbläsare @@ -860,7 +860,7 @@ Choose your content location - + Välj plats för din volym @@ -966,12 +966,12 @@ Unsubscribe from %1 - + Avbryt prenumeration från %1 Subscribe to %1 - + Prenumerera på %1 @@ -989,22 +989,22 @@ A new version of %1 is available! - + En ny version av %1 Finns tillgänglig! %1 %2 is now available. You have %3. - + %1 %2 är nu tillgänglig. Du har %3. Would you like to download it now? - + Vill du ladda ner den nu? Skip This Version - + Hoppa Över Denna Version @@ -1040,42 +1040,42 @@ Preparing - + Förbereder Failed - + Misslyckades Completed - + Färdig Stopped - + Stoppad Stop downloading - + Stoppa nerladdning Show in %1 - + Visa i %1 Open parent folder - + Öppna ursprungsmappen Restart downloading - + Starta om nerladdning @@ -1088,7 +1088,7 @@ Show %1 More - + Visa %1 Till @@ -1098,7 +1098,7 @@ No more videos - + Inga fler videor @@ -1106,33 +1106,33 @@ Sort by - + Sortera enligt Relevance - + Relevans Date - + Datum View Count - + Mest sedda Rating - + Betyg Anytime - + Närsomhelst @@ -1152,7 +1152,7 @@ Duration - + Längd @@ -1282,17 +1282,17 @@ &Back - + &Tillbaka Forward to %1 - + Framåt till %1 Back to %1 - + Tillbaka till %1 @@ -1300,7 +1300,7 @@ Refine Search - + Förfinad sökning @@ -1313,27 +1313,27 @@ Most Popular - + Mest Populär Most Shared - + Flest Delningar Most Discussed - + Mest Omtalad Top Rated - + Högsta Betyg All Time Popular - + Mest populära genom tiderna @@ -1354,72 +1354,72 @@ Algeria - + Algeriet Argentina - + Argentina Australia - + Australien Belgium - + Belgien Brazil - + Brasilien Canada - + Kanada Chile - + Chile Colombia - + Colombia Czech Republic - + Tjeckiska Republiken Egypt - + Egypten France - + Frankrike Germany - + Tyskland Ghana - + Ghana Greece - + Grekland @@ -1429,17 +1429,17 @@ Hungary - + Ungern India - + Indien Indonesia - + Indonesien @@ -1459,57 +1459,57 @@ Japan - + Japan Jordan - + Jordanien Kenya - + Kenya Malaysia - + Malaysia Mexico - + Mexico Morocco - + Marocco Netherlands - + Nederländerna New Zealand - + Nya Zeeland Nigeria - + Nigeria Peru - + Peru Philippines - + Filippinerna @@ -1524,22 +1524,22 @@ Saudi Arabia - + Saudi Arabien Singapore - + Singapore South Africa - + Syd Afrika South Korea - + Syd Korea @@ -1554,12 +1554,12 @@ Taiwan - + Taiwan Tunisia - + Tunisien @@ -1569,27 +1569,27 @@ Uganda - + Uganda United Arab Emirates - + Förenade Arab Emiraten United Kingdom - + Storbritannien Yemen - + Jemen Worldwide - + Från Hela Världen \ No newline at end of file diff --git a/locale/tr.ts b/locale/tr.ts index fde27d6..49912be 100644 --- a/locale/tr.ts +++ b/locale/tr.ts @@ -704,7 +704,7 @@ Open in &Browser... - + &Tarayıcıda aç... diff --git a/locale/uk.ts b/locale/uk.ts index 87a6f9c..ad27098 100644 --- a/locale/uk.ts +++ b/locale/uk.ts @@ -20,17 +20,17 @@ %1 is Free Software but its development takes precious time. - %1 — вільне програмне забезпечення, але на його розробку було затрачено коштовний час. + %1 — вільне проґрамне забезпечення, але на його розробку було затрачено коштовний час. Please <a href='%1'>donate</a> to support the continued development of %2. - Будь ласка, <a href='%1'>внесіть пожертву</a> щоб підтримати подальший розвиток %2. + Будь ласка, <a href='%1'>внесіть пожертву,</a> щоб підтримати подальший розвиток %2. You may want to try my other apps as well: - Спробуйте інші програми: + Спробуйте інші проґрами: @@ -45,12 +45,12 @@ Translate %1 to your native language using %2 - Перекласти %1 на вашу рідну мову за допомогою %2 + Перекласти %1 вашою рідною мовою за допомогою %2 Icon designed by %1. - Розробник піктограм %1. + Розробник піктоґрам %1. @@ -65,12 +65,12 @@ About - Про програму + Про проґраму What you always wanted to know about %1 and never dared to ask - Усе що ви завжди хотіли знати про %1, але не наважувалися запитати + Усе, що ви завжди хотіли знати про %1, але не наважувалися запитати @@ -78,7 +78,7 @@ Enter your License Details - Введіть дані вашої ліцензії + Уведіть дані вашої ліцензії @@ -112,12 +112,12 @@ Without a license, the application will expire in %1 days. - Програму буде заблоковано через %1 днів, якщо ви не придбаєте ліцензію. + Проґраму буде заблоковано через %1 днів, якщо ви не придбаєте ліцензію. By purchasing the full version, you will also support the hard work I put into creating %1. - При покупці повної версії, ви також надаєте підтримку тяжкої роботи у створенні %1. + При купівлі повної версії, ви, також, надаєте підтримку важкій роботі, яка була задіяна під час створення %1. @@ -127,7 +127,7 @@ Enter License - Ввести ліцензію + Увести ліцензію @@ -153,12 +153,12 @@ All Videos - Усе відео + Усі відео Unwatched Videos - Непереглянутих відео + Непереглянуті відео @@ -166,7 +166,7 @@ Mark all as watched - Скасувати усе як переглянуте + Позначити все переглянутим @@ -196,32 +196,32 @@ Most Watched - Що найбільше переглядаються + Найбільш переглядаюче Sort by - Сортувати по + Сортувати за All Videos - Усе відео + Усіма відео Unwatched Videos - Не переглянуте відео + Не переглянутими відео There are no updated subscriptions at this time. - На даний час немає оновлень підписок. + Наразі оновлень підписок немає. You have no subscriptions. Use the star symbol to subscribe to channels. - В вас немає підписок. Використовуйте символ зірочки щоб підписуватися на канали. + У вас немає підписок. Використовуйте символ зірочки, щоб підписуватися на канали. @@ -237,7 +237,7 @@ bytes - байт + байтів @@ -300,7 +300,7 @@ Get the full version - Отримати повнофункціональну версію + Отримати повну версію @@ -338,7 +338,7 @@ Current downloads will still go in the previous location. - Поточні завантаження усе ще буде збережено у попередньому місці. + Поточні завантаження буде як і раніше збережено у попередньому місці. @@ -360,7 +360,7 @@ Downloading update... - Завантажую оновлення ... + Завантаження оновлення... @@ -388,27 +388,27 @@ Stop playing after current track - Зупинити по завершенні поточного + Зупинити після завершення поточного Next track - Наступний + Наступний трек Previous track - Попередній + Попередній трек Increase volume - Підвищити гучність + Збільшити гучність Decrease volume - Знизити гучність + Зменшити гучність @@ -418,12 +418,12 @@ Seek forward - Шукати наступне + Перемотати вперед Seek backward - Шукати попереднє + Перемотати назад @@ -446,7 +446,7 @@ Browse videos by category - Огляд відео по категоріях + Огляд відео за катеґоріями @@ -461,7 +461,7 @@ Make yourself comfortable - Влаштовуйтеся якнайзручніше + Влаштовуйтесь якнайзручніше @@ -514,17 +514,17 @@ Go full screen - Перехід у повноекранний режим + Перейти у повноекранний режим Hide the playlist and the toolbar - Сховати список та панель інструментів + Сховати перелік та панель інструментів Go to the YouTube video page and pause playback - Відкрити сторінку YouTube та призупини відтворення відео + Відкрити сторінку YouTube та призупинити відтворення відео @@ -549,27 +549,27 @@ Remove the selected videos from the playlist - Вилучити обрані відео зі списку + Вилучити обрані відео з переліку Move &Up - В&гору + До&гори Move up the selected videos in the playlist - Перемістити обране відео вгору по списку + Перемістити обране відео вгору по переліку Move &Down - Вни&з + Дони&зу Move down the selected videos in the playlist - Перемістити обране відео вниз по списку + Перемістити обране відео вниз по переліку @@ -579,7 +579,7 @@ &Quit - &Ви&хід + &Ви&йти @@ -599,12 +599,12 @@ Please support the continued development of %1 - Будь ласка підтримайте подальший розвиток %1 + Будь ласка, підтримайте подальший розвиток %1 &About - &Про програму + &Про проґраму @@ -640,7 +640,7 @@ Download the current video - Завантажити поточне відео + Завантажити це відео @@ -670,7 +670,7 @@ &Float on Top - &Зверху усіх вікон + &Згори усіх вікон @@ -695,7 +695,7 @@ &Related Videos - По&дібне відео + Схо&же відео @@ -705,12 +705,12 @@ Open in &Browser... - Відкрити in &Браузер... + Відкрити у &браузері... &Application - Пр&ограма + Пр&оґрама @@ -725,7 +725,7 @@ &Playlist - &Список відтворення + &Перелік відтворення @@ -735,7 +735,7 @@ &View - &Вигляд + &Переглянути @@ -750,7 +750,7 @@ Press %1 to raise the volume, %2 to lower it - Натисніть %1, щоб приглушити гучність, та %2 щоб відновити її + Натисніть %1, аби приглушити гучність, та %2, щоб її відновити @@ -761,7 +761,7 @@ Do you want to exit %1 with a download in progress? - Триває завантаження, бажаете закрити %1? + Триває завантаження, бажаєте закрити %1? @@ -836,7 +836,7 @@ Find Video &Parts - Знайти &фрагменти відео + Знайти &фраґменти відео @@ -861,7 +861,7 @@ Choose your content location - Вибір місцерозміщення + Оберіть своє місцерозташування @@ -919,7 +919,7 @@ You can now paste the video stream URL into another application - Ви можете використовувати посилання на відео у зовнішній програмі + Ви можете використовувати посилання на відео у зовнішній проґрамі @@ -962,7 +962,7 @@ Sent from %1 - Відправити з %1 + Надіслати з %1 @@ -977,7 +977,7 @@ Get the full version - Отримати повнофункціональну версію + Отримати повну версію @@ -1000,7 +1000,7 @@ Would you like to download it now? - Ви бажаєте завантажити зараз? + Бажаєте завантажити це зараз? @@ -1041,7 +1041,7 @@ Preparing - Готується + Підготовка @@ -1051,7 +1051,7 @@ Completed - Завершено + Виконано @@ -1107,28 +1107,28 @@ Sort by - Сортувати по + Сортувати за Relevance - Релевантність + Релевантністю Date - Дата + Датою View Count - Кількість переглядів + Числом переглядів Rating - Рейтинг + Рейтинґом @@ -1153,7 +1153,7 @@ Duration - Тривалість + Тривалістю @@ -1225,7 +1225,7 @@ Search - Пошук + Шукати @@ -1238,13 +1238,13 @@ Get the full version - Отримати повнофункціональну версію + Отримати повну версію Enter "Enter", as in "type". The whole phrase says: "Enter a keyword to start watching videos" - Введіть + Уведіть @@ -1259,17 +1259,17 @@ to start watching videos. - щоб почати перегляд. + аби розпочати перегляд. Watch - Перегляд + Дивитися Recent keywords - Недавній пошук + Нещодавній пошук @@ -1288,7 +1288,7 @@ Forward to %1 - Вперед до %1 + Уперед до %1 @@ -1306,7 +1306,7 @@ Did you mean: %1 - Можливо ви мали на увазі: %1 + Можливо, ви мали на увазі: %1 @@ -1319,22 +1319,22 @@ Most Shared - Most Shared + Найпоширюваніше Most Discussed - Що найбільше обговорюють + Найбільш обговорюване Top Rated - Кращі оцінки + Найкраще All Time Popular - Популярне за увесь час + Популярне за весь час @@ -1415,7 +1415,7 @@ Ghana - Гана + Ґана @@ -1425,7 +1425,7 @@ Hong Kong - Гонконг + Гонконґ @@ -1500,7 +1500,7 @@ Nigeria - Нігерія + Ніґерія @@ -1510,7 +1510,7 @@ Philippines - Філіпіни + Філіппіни @@ -1530,7 +1530,7 @@ Singapore - Сингапур + Синґапур @@ -1570,7 +1570,7 @@ Uganda - Уганда + Уґанда @@ -1585,7 +1585,7 @@ Yemen - Йемен + Ємен diff --git a/locale/uk_UA.ts b/locale/uk_UA.ts index 1ebd77e..257a289 100644 --- a/locale/uk_UA.ts +++ b/locale/uk_UA.ts @@ -20,17 +20,17 @@ %1 is Free Software but its development takes precious time. - %1 — вільне програмне забезпечення, але на його розробку було затрачено коштовний час. + %1 — вільне проґрамне забезпечення, але на його розробку було затрачено коштовний час. Please <a href='%1'>donate</a> to support the continued development of %2. - Будь ласка, <a href='%1'>внесіть пожертву</a> щоб підтримати подальший розвиток %2. + Будь ласка, <a href='%1'>внесіть пожертву,</a> щоб підтримати подальший розвиток %2. You may want to try my other apps as well: - Спробуйте інші програми: + Спробуйте інші проґрами: @@ -45,12 +45,12 @@ Translate %1 to your native language using %2 - Перекласти %1 на вашу рідну мову за допомогою %2 + Перекласти %1 вашою рідною мовою за допомогою %2 Icon designed by %1. - Розробник піктограм %1. + Розробник піктоґрам %1. @@ -65,12 +65,12 @@ About - Про програму + Про проґраму What you always wanted to know about %1 and never dared to ask - Усе що ви завжди хотіли знати про %1, але не наважувалися запитати + Усе, що ви завжди хотіли знати про %1, але не наважувалися запитати @@ -78,7 +78,7 @@ Enter your License Details - Введіть дані вашої ліцензії + Уведіть дані вашої ліцензії @@ -112,12 +112,12 @@ Without a license, the application will expire in %1 days. - Програму буде заблоковано через %1 днів, якщо ви не придбаєте ліцензію. + Проґраму буде заблоковано через %1 днів, якщо ви не придбаєте ліцензію. By purchasing the full version, you will also support the hard work I put into creating %1. - При покупці повної версії, ви також надаєте підтримку тяжкої роботи у створенні %1. + При купівлі повної версії, ви, також, надаєте підтримку важкій роботі, яка була задіяна під час створення %1. @@ -127,7 +127,7 @@ Enter License - Ввести ліцензію + Увести ліцензію @@ -153,12 +153,12 @@ All Videos - Усе відео + Усі відео Unwatched Videos - Непереглянутих відео + Непереглянуті відео @@ -166,7 +166,7 @@ Mark all as watched - Скасувати усе як переглянуте + Позначити все переглянутим @@ -196,32 +196,32 @@ Most Watched - Що найбільше переглядаються + Найбільш переглядаюче Sort by - Сортувати по + Сортувати за All Videos - Усе відео + Усіма відео Unwatched Videos - Не переглянуте відео + Не переглянутими відео There are no updated subscriptions at this time. - На даний час немає оновлень підписок. + Наразі оновлень підписок немає. You have no subscriptions. Use the star symbol to subscribe to channels. - В вас немає підписок. Використовуйте символ зірочки щоб підписуватися на канали. + У вас немає підписок. Використовуйте символ зірочки, щоб підписуватися на канали. @@ -237,7 +237,7 @@ bytes - байт + байтів @@ -300,7 +300,7 @@ Get the full version - Отримати повнофункціональну версію + Отримати повну версію @@ -338,7 +338,7 @@ Current downloads will still go in the previous location. - Поточні завантаження усе ще буде збережено у попередньому місці. + Поточні завантаження буде як і раніше збережено у попередньому місці. @@ -360,7 +360,7 @@ Downloading update... - Завантажую оновлення ... + Завантаження оновлення... @@ -388,27 +388,27 @@ Stop playing after current track - Зупинити по завершенні поточного + Зупинити після завершення поточного Next track - Наступний + Наступний трек Previous track - Попередній + Попередній трек Increase volume - Підвищити гучність + Збільшити гучність Decrease volume - Знизити гучність + Зменшити гучність @@ -418,12 +418,12 @@ Seek forward - Шукати наступне + Перемотати вперед Seek backward - Шукати попереднє + Перемотати назад @@ -446,7 +446,7 @@ Browse videos by category - Огляд відео по категоріях + Огляд відео за катеґоріями @@ -461,7 +461,7 @@ Make yourself comfortable - Влаштовуйтеся якнайзручніше + Влаштовуйтесь якнайзручніше @@ -514,17 +514,17 @@ Go full screen - Перехід у повноекранний режим + Перейти у повноекранний режим Hide the playlist and the toolbar - Сховати список та панель інструментів + Сховати перелік та панель інструментів Go to the YouTube video page and pause playback - Відкрити сторінку YouTube та призупини відтворення відео + Відкрити сторінку YouTube та призупинити відтворення відео @@ -549,27 +549,27 @@ Remove the selected videos from the playlist - Вилучити обрані відео зі списку + Вилучити обрані відео з переліку Move &Up - В&гору + До&гори Move up the selected videos in the playlist - Перемістити обране відео вгору по списку + Перемістити обране відео вгору по переліку Move &Down - Вни&з + Дони&зу Move down the selected videos in the playlist - Перемістити обране відео вниз по списку + Перемістити обране відео вниз по переліку @@ -579,7 +579,7 @@ &Quit - &Ви&хід + &Ви&йти @@ -599,12 +599,12 @@ Please support the continued development of %1 - Будь ласка підтримайте подальший розвиток %1 + Будь ласка, підтримайте подальший розвиток %1 &About - &Про програму + &Про проґраму @@ -640,7 +640,7 @@ Download the current video - Завантажити поточне відео + Завантажити це відео @@ -670,7 +670,7 @@ &Float on Top - &Зверху усіх вікон + &Згори усіх вікон @@ -695,7 +695,7 @@ &Related Videos - По&дібне відео + Схо&же відео @@ -705,12 +705,12 @@ Open in &Browser... - Відкрити &Браузер.. + Відкрити у &браузері... &Application - Пр&ограма + Пр&оґрама @@ -725,7 +725,7 @@ &Playlist - &Список відтворення + &Перелік відтворення @@ -735,7 +735,7 @@ &View - &Вигляд + &Переглянути @@ -750,7 +750,7 @@ Press %1 to raise the volume, %2 to lower it - Натисніть %1, щоб приглушити гучність, та %2 щоб відновити її + Натисніть %1, аби приглушити гучність, та %2, щоб її відновити @@ -761,7 +761,7 @@ Do you want to exit %1 with a download in progress? - Триває завантаження, бажаете закрити %1? + Триває завантаження, бажаєте закрити %1? @@ -836,7 +836,7 @@ Find Video &Parts - Знайти &фрагменти відео + Знайти &фраґменти відео @@ -861,7 +861,7 @@ Choose your content location - Вибір місцерозміщення + Оберіть своє місцерозташування @@ -919,7 +919,7 @@ You can now paste the video stream URL into another application - Ви можете використовувати посилання на відео у зовнішній програмі + Ви можете використовувати посилання на відео у зовнішній проґрамі @@ -962,7 +962,7 @@ Sent from %1 - Відправити з %1 + Надіслати з %1 @@ -977,7 +977,7 @@ Get the full version - Отримати повнофункціональну версію + Отримати повну версію @@ -1000,7 +1000,7 @@ Would you like to download it now? - Ви бажаєте завантажити зараз? + Бажаєте завантажити це зараз? @@ -1041,7 +1041,7 @@ Preparing - Готується + Підготовка @@ -1051,7 +1051,7 @@ Completed - Завершено + Виконано @@ -1107,28 +1107,28 @@ Sort by - Сортувати по + Сортувати за Relevance - Релевантність + Релевантністю Date - Дата + Датою View Count - Кількість переглядів + Числом переглядів Rating - Рейтинг + Рейтинґом @@ -1153,7 +1153,7 @@ Duration - Тривалість + Тривалістю @@ -1225,7 +1225,7 @@ Search - Пошук + Шукати @@ -1238,13 +1238,13 @@ Get the full version - Отримати повнофункціональну версію + Отримати повну версію Enter "Enter", as in "type". The whole phrase says: "Enter a keyword to start watching videos" - Введіть + Уведіть @@ -1259,17 +1259,17 @@ to start watching videos. - щоб почати перегляд. + аби розпочати перегляд. Watch - Перегляд + Дивитися Recent keywords - Недавній пошук + Нещодавній пошук @@ -1288,7 +1288,7 @@ Forward to %1 - Вперед до %1 + Уперед до %1 @@ -1306,7 +1306,7 @@ Did you mean: %1 - Можливо ви мали на увазі: %1 + Можливо, ви мали на увазі: %1 @@ -1319,22 +1319,22 @@ Most Shared - Most Shared + Найпоширюваніше Most Discussed - Що найбільше обговорюють + Найбільш обговорюване Top Rated - Кращі оцінки + Найкраще All Time Popular - Популярне за увесь час + Популярне за весь час @@ -1415,7 +1415,7 @@ Ghana - Гана + Ґана @@ -1425,7 +1425,7 @@ Hong Kong - Гонконг + Гонконґ @@ -1500,7 +1500,7 @@ Nigeria - Нігерія + Ніґерія @@ -1510,7 +1510,7 @@ Philippines - Філіпіни + Філіппіни @@ -1530,7 +1530,7 @@ Singapore - Сингапур + Синґапур @@ -1570,7 +1570,7 @@ Uganda - Уганда + Уґанда @@ -1585,7 +1585,7 @@ Yemen - Йемен + Ємен diff --git a/locale/zh_CN.ts b/locale/zh_CN.ts index b752ca3..b30fd88 100644 --- a/locale/zh_CN.ts +++ b/locale/zh_CN.ts @@ -175,7 +175,7 @@ Name - + 姓名 diff --git a/locale/zh_TW.ts b/locale/zh_TW.ts index 414c5c4..8b37e62 100644 --- a/locale/zh_TW.ts +++ b/locale/zh_TW.ts @@ -704,7 +704,7 @@ Open in &Browser... - + 在瀏覽器中開啟(&B)... diff --git a/minitube.desktop b/minitube.desktop index 63df494..a3fe782 100644 --- a/minitube.desktop +++ b/minitube.desktop @@ -16,8 +16,8 @@ Exec=minitube Terminal=false Type=Application Icon=minitube -Categories=Qt;AudioVideo;Video;Player; -StartupNotify=true +Categories=AudioVideo;Player;Qt; +StartupNotify=false Actions=TogglePlaying;Next;Previous; [Desktop Action TogglePlaying] diff --git a/minitube.pro b/minitube.pro index 40fb16d..463f328 100644 --- a/minitube.pro +++ b/minitube.pro @@ -1,6 +1,6 @@ CONFIG += release TEMPLATE = app -VERSION = 2.1.3 +VERSION = 2.1.5 DEFINES += APP_VERSION="$$VERSION" APP_NAME = Minitube @@ -13,9 +13,12 @@ DEFINES *= QT_NO_DEBUG_OUTPUT DEFINES *= QT_USE_QSTRINGBUILDER DEFINES += QT_STRICT_ITERATORS -TARGET = minitube +TARGET = $${APP_UNIX_NAME} + QT += network xml phonon sql script + include(src/qtsingleapplication/qtsingleapplication.pri) + HEADERS += \ src/video.h \ src/searchlineedit.h \ diff --git a/src/aboutview.cpp b/src/aboutview.cpp index f173a38..92d6638 100644 --- a/src/aboutview.cpp +++ b/src/aboutview.cpp @@ -48,7 +48,7 @@ AboutView::AboutView(QWidget *parent) : QWidget(parent) { hLayout->addLayout(layout); QString info = "" - "

" + QString(Constants::NAME) + "

" + "

" + QString(Constants::NAME) + "

" "

" + tr("There's life outside the browser!") + "

" "

" + tr("Version %1").arg(Constants::VERSION) + "

" + QString("

%1

").arg(Constants::WEBSITE); @@ -89,7 +89,7 @@ AboutView::AboutView(QWidget *parent) : QWidget(parent) { "

" + tr("Released under the GNU General Public License") .arg("http://www.gnu.org/licenses/gpl.html") + "

" #endif - "

© 2009-2013 " + Constants::ORG_NAME + "

" + "

© 2009-2014 " + Constants::ORG_NAME + "

" ""; QLabel *infoLabel = new QLabel(info, this); infoLabel->setOpenExternalLinks(true); diff --git a/src/diskcache.cpp b/src/diskcache.cpp index 36234d1..f9d0391 100644 --- a/src/diskcache.cpp +++ b/src/diskcache.cpp @@ -33,7 +33,8 @@ QIODevice* DiskCache::prepare(const QNetworkCacheMetaData &metaData) { } } - if (mime.startsWith(QLatin1String("image/"))) + if (mime.startsWith(QLatin1String("image/")) || + mime.endsWith(QLatin1String("/javascript"))) return QNetworkDiskCache::prepare(metaData); return 0; diff --git a/src/loadingwidget.cpp b/src/loadingwidget.cpp index 79efe0d..1a3701e 100644 --- a/src/loadingwidget.cpp +++ b/src/loadingwidget.cpp @@ -62,8 +62,9 @@ LoadingWidget::LoadingWidget(QWidget *parent) : QWidget(parent) { void LoadingWidget::setVideo(Video *video) { QFont titleFont; + titleFont.setStyleName("Light"); #ifdef APP_MAC - titleFont.setFamily("Helvetica"); + titleFont.setFamily("Helvetica Neue"); #endif #ifdef APP_WIN titleFont.setFamily("Segoe UI Light"); diff --git a/src/main.cpp b/src/main.cpp index 95e9f12..d26a9ff 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -35,6 +35,8 @@ int main(int argc, char **argv) { #ifdef Q_WS_MAC mac::MacMain(); + // https://bugreports.qt-project.org/browse/QTBUG-32789 + QFont::insertSubstitution(".Lucida Grande UI", "Lucida Grande"); #endif QtSingleApplication app(argc, argv); @@ -75,7 +77,11 @@ int main(int argc, char **argv) { #else QString dataDir = ""; #endif +#ifdef APP_MAC + QString localeDir = qApp->applicationDirPath() + "/../Resources/locale"; +#else QString localeDir = qApp->applicationDirPath() + "/locale"; +#endif if (!QDir(localeDir).exists()) { localeDir = dataDir + "/locale"; } diff --git a/src/mainwindow.h b/src/mainwindow.h index 404fa13..159ffb6 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -151,7 +151,6 @@ private: QWidget *regionsView; // actions - QAction *addGadgetAct; QAction *backAct; QAction *quitAct; QAction *siteAct; diff --git a/src/playlistitemdelegate.cpp b/src/playlistitemdelegate.cpp index b681347..295eba8 100644 --- a/src/playlistitemdelegate.cpp +++ b/src/playlistitemdelegate.cpp @@ -224,6 +224,27 @@ void PlaylistItemDelegate::paintBody( QPainter* painter, } + } else { + + bool isHovered = option.state & QStyle::State_MouseOver; + if (!isActive && isHovered) { + painter->setFont(smallerFont); + painter->setPen(Qt::white); + QString videoTitle = video->title(); + QString v = videoTitle; + const int flags = Qt::AlignTop | Qt::TextWordWrap; + QRect textBox(PADDING, PADDING, THUMB_WIDTH - PADDING*2, THUMB_HEIGHT - PADDING*2); + textBox = painter->boundingRect(textBox, flags, v); + while (textBox.height() > THUMB_HEIGHT && v.length() > 10) { + videoTitle.truncate(videoTitle.length() - 1); + v = videoTitle; + v = v.trimmed().append("..."); + textBox = painter->boundingRect(textBox, flags, v); + } + painter->fillRect(QRect(0, 0, THUMB_WIDTH, textBox.height() + PADDING*2), QColor(0, 0, 0, 128)); + painter->drawText(textBox, flags, v); + } + } painter->restore(); diff --git a/src/searchview.cpp b/src/searchview.cpp index 522701e..6cbaa1d 100644 --- a/src/searchview.cpp +++ b/src/searchview.cpp @@ -84,10 +84,16 @@ SearchView::SearchView(QWidget *parent) : QWidget(parent) { hLayout->addLayout(layout); QLabel *welcomeLabel = - new QLabel("

" + + new QLabel("

" + tr("Welcome to %2,") // .replace("", this); welcomeLabel->setOpenExternalLinks(true); diff --git a/src/video.cpp b/src/video.cpp index 8cb1f97..67796e7 100644 --- a/src/video.cpp +++ b/src/video.cpp @@ -183,7 +183,7 @@ void Video::gotVideoInfo(QByteArray data) { parseFmtUrlMap(fmtUrlMap); } -void Video::parseFmtUrlMap(QString fmtUrlMap, bool fromWebPage) { +void Video::parseFmtUrlMap(const QString &fmtUrlMap, bool fromWebPage) { QSettings settings; QString definitionName = settings.value("definition", "360p").toString(); int definitionCode = VideoDefinition::getDefinitionCode(definitionName); @@ -200,7 +200,7 @@ void Video::parseFmtUrlMap(QString fmtUrlMap, bool fromWebPage) { QString url; QString sig; foreach(QString urlParam, urlParams) { - // qDebug() << urlParam; + // qWarning() << urlParam; if (urlParam.startsWith("itag=")) { int separator = urlParam.indexOf("="); format = urlParam.mid(separator + 1).toInt(); @@ -219,8 +219,11 @@ void Video::parseFmtUrlMap(QString fmtUrlMap, bool fromWebPage) { sig = QByteArray::fromPercentEncoding(sig.toUtf8()); if (ageGate) sig = JsFunctions::instance()->decryptAgeSignature(sig); - else - sig = JsFunctions::instance()->decryptSignature(sig); + else { + sig = decryptSignature(sig); + if (sig.isEmpty()) + sig = JsFunctions::instance()->decryptSignature(sig); + } } else { // qDebug() << "Loading webpage"; QUrl url("http://www.youtube.com/watch"); @@ -246,7 +249,7 @@ void Video::parseFmtUrlMap(QString fmtUrlMap, bool fromWebPage) { // qWarning() << url; if (format == definitionCode) { - // qDebug() << "Found format" << definitionCode; + qDebug() << "Found format" << definitionCode; QUrl videoUrl = QUrl::fromEncoded(url.toUtf8(), QUrl::StrictMode); m_streamUrl = videoUrl; this->definitionCode = definitionCode; @@ -266,7 +269,7 @@ void Video::parseFmtUrlMap(QString fmtUrlMap, bool fromWebPage) { if (previousIndex < 0) previousIndex = 0; int definitionCode = definitionCodes.at(previousIndex); if (urlMap.contains(definitionCode)) { - // qDebug() << "Found format" << definitionCode; + qDebug() << "Found format" << definitionCode; QString url = urlMap.value(definitionCode); QUrl videoUrl = QUrl::fromEncoded(url.toUtf8(), QUrl::StrictMode); m_streamUrl = videoUrl; @@ -321,9 +324,25 @@ void Video::scrapeWebPage(QByteArray data) { getVideoInfo(); return; } - QString fmtUrlMap = re.cap(1); + fmtUrlMap = re.cap(1); fmtUrlMap.replace("\\u0026", "&"); - parseFmtUrlMap(fmtUrlMap, true); + // parseFmtUrlMap(fmtUrlMap, true); + + QRegExp jsPlayerRe("\"assets\":.+\"js\":\\s*\"([^\"]+)\""); + if (jsPlayerRe.indexIn(html) != -1) { + QString jsPlayerUrl = jsPlayerRe.cap(1); + jsPlayerUrl.remove('\\'); + jsPlayerUrl = "http:" + jsPlayerUrl; + qWarning() << "jsPlayerUrl" << jsPlayerUrl; + /* + QRegExp jsPlayerIdRe("-(.+)\\.js"); + jsPlayerIdRe.indexIn(jsPlayerUrl); + QString jsPlayerId = jsPlayerRe.cap(1); + */ + QObject *reply = The::http()->get(jsPlayerUrl); + connect(reply, SIGNAL(data(QByteArray)), SLOT(parseJsPlayer(QByteArray))); + connect(reply, SIGNAL(error(QNetworkReply*)), SLOT(errorVideoInfo(QNetworkReply*))); + } } void Video::gotHeadHeaders(QNetworkReply* reply) { @@ -369,6 +388,60 @@ void Video::gotHeadHeaders(QNetworkReply* reply) { } } +void Video::parseJsPlayer(QByteArray bytes) { + QString js = QString::fromUtf8(bytes); + QRegExp funcNameRe("signature=([a-zA-Z0-9]+)"); + if (funcNameRe.indexIn(js) == -1) { + qWarning() << "Cannot capture signature function name"; + } else { + sigFuncName = funcNameRe.cap(1); + captureFunction(sigFuncName, js); + // qDebug() << sigFunctions; + } + parseFmtUrlMap(fmtUrlMap, true); +} + +void Video::captureFunction(const QString &name, const QString &js) { + QRegExp funcRe("function\\s+" + name + "\\s*\\([a-zA-Z0-9,\\s]*\\)\\s*\\{[^\\}]+\\}"); + if (funcRe.indexIn(js) == -1) { + qWarning() << "Cannot capture function" << name; + return; + } + QString func = funcRe.cap(0); + sigFunctions.insert(name, func); + + // capture inner functions + QRegExp invokedFuncRe("[\\s=;\\(]([a-zA-Z0-9]+)\\s*\\([a-zA-Z0-9, ]+\\)"); + int pos = name.length() + 9; + while ((pos = invokedFuncRe.indexIn(func, pos)) != -1) { + QString funcName = invokedFuncRe.cap(1); + if (!sigFunctions.contains(funcName)) + captureFunction(funcName, js); + pos += invokedFuncRe.matchedLength(); + } +} + +QString Video::decryptSignature(const QString &s) { + if (sigFuncName.isEmpty()) return QString(); + QScriptEngine engine; + foreach (QString f, sigFunctions.values()) { + QScriptValue value = engine.evaluate(f); + if (value.isError()) + qWarning() << "Error in" << f << value.toString(); + } + QString js = sigFuncName + "('" + s + "');"; + QScriptValue value = engine.evaluate(js); + if (value.isUndefined()) { + qWarning() << "Undefined result for" << js; + return QString(); + } + if (value.isError()) { + qWarning() << "Error in" << js << value.toString(); + return QString(); + } + return value.toString(); +} + void Video::findVideoUrl(int definitionCode) { this->definitionCode = definitionCode; @@ -381,7 +454,6 @@ void Video::findVideoUrl(int definitionCode) { // connect(reply, SIGNAL(error(QNetworkReply*)), SLOT(errorVideoInfo(QNetworkReply*))); // see you in gotHeadHeaders() - } QString Video::formattedDuration() const { diff --git a/src/video.h b/src/video.h index 76a9f58..7220a4d 100644 --- a/src/video.h +++ b/src/video.h @@ -95,12 +95,15 @@ private slots: void errorVideoInfo(QNetworkReply*); void scrapeWebPage(QByteArray); void gotHeadHeaders(QNetworkReply*); + void parseJsPlayer(QByteArray); private: void getVideoInfo(); void findVideoUrl(int definitionCode); void foundVideoUrl(QString videoToken, int definitionCode); - void parseFmtUrlMap(QString fmtUrlMap, bool fromWebPage = false); + void parseFmtUrlMap(const QString &fmtUrlMap, bool fromWebPage = false); + void captureFunction(const QString &name, const QString &js); + QString decryptSignature(const QString &s); QString m_title; QString m_description; @@ -126,6 +129,10 @@ private: bool loadingStreamUrl; bool loadingThumbnail; + + QHash sigFunctions; + QString sigFuncName; + QString fmtUrlMap; }; // This is required in order to use QPointer