From 4c0809d3d3f67ba9a369f809cf5047f96294ce5a Mon Sep 17 00:00:00 2001 From: Christian Schabesberger Date: Fri, 11 Mar 2016 15:06:30 +0100 Subject: [PATCH 1/6] Translated using Weblate (German) Currently translated at 100.0% (104 of 104 strings) --- app/src/main/res/values-de/strings.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 8636e9fa9..827474c91 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -60,7 +60,7 @@ Netzwerkfehler Downloadverzeichnis für Musik - Verzeichnis zum Speichern heruntergeladener Audiodateien + Verzeichnis zum Speichern heruntergeladener Audiodateien. Pfad für heruntergeladene Audiodateien eingeben. Aussehen @@ -91,7 +91,7 @@ MELDEN Info: Dies ist passiert: - Was:\\nAnfrage:\\nSprache des Inhalts:\\nDienst:\\nZeit (GMT):\\nVersion:\\nBS-Version:\\nGlob. IP-Bereich: + Was:\\nAnfrage:\\nSprache des Inhalts:\\nDienst:\\nZeit (GMT):\\nVersion:\\nOS-Version:\\nGlob. IP-Bereich: Details: From 247681e3efbded165fa7202a3447cb69694a7631 Mon Sep 17 00:00:00 2001 From: Matej U Date: Fri, 11 Mar 2016 23:46:19 +0100 Subject: [PATCH 2/6] Translated using Weblate (Slovenian) Currently translated at 100.0% (106 of 106 strings) --- app/src/main/res/values-sl/strings.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/src/main/res/values-sl/strings.xml b/app/src/main/res/values-sl/strings.xml index e38bb232b..9db3edddd 100644 --- a/app/src/main/res/values-sl/strings.xml +++ b/app/src/main/res/values-sl/strings.xml @@ -118,4 +118,9 @@ Ni mogoče preiskati dekodirnikov na napravi Ni mogoče začeti dekodirnika %1$s Dovoljenje za dostop do shrambe je zavrnjeno + Samodejno predvajaj vsebino, poslano iz drugega programa. + Samodejno predvajaj vsebino, če je NewPipe klican iz drugega programa. + Pošlji poročilo o napaki + Poročilo uporabnika + From c57cb8fec1e960920b941bd34bab3ebc626d618d Mon Sep 17 00:00:00 2001 From: naofum Date: Sat, 12 Mar 2016 06:27:42 +0100 Subject: [PATCH 3/6] Translated using Weblate (Japanese) Currently translated at 100.0% (106 of 106 strings) --- app/src/main/res/values-ja/strings.xml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index 2498500c3..eaee7b686 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -119,4 +119,9 @@ ストレージにアクセスするアクセス許可が拒否されました ExoPlayer を使用する 実験的 - +別のアプリから呼び出されたときに自動再生。 + NewPipe が別のアプリから呼び出されたときに、自動的にビデオを再生します。 + エラーを報告 + ユーザー報告 + + From e9b900ff28a8e3ed165dda6422e91323d8916d7e Mon Sep 17 00:00:00 2001 From: Benedikt Freisen Date: Sat, 12 Mar 2016 11:57:49 +0100 Subject: [PATCH 4/6] Translated using Weblate (German) Currently translated at 100.0% (106 of 106 strings) --- app/src/main/res/values-de/strings.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 827474c91..e8865273d 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -120,4 +120,9 @@ Dieses Gerät stellt keinen abgesicherten Dekodierer für %1$s bereit Konnte keinen Stream holen. Geschützte Inhalte werden von API-Ebenen unterhalb von 18 nicht unterstützt + Bei Aufruf aus einer anderen App automatisch abspielen. + Spielt ein Video automatisch ab, wenn NewPipe von einer anderen App aufgerufen wurde. + Einen Fehler melden + Anwenderbericht + From 21768432c89644c9b84d1f08e33400e3b0825684 Mon Sep 17 00:00:00 2001 From: rrooij Date: Sat, 12 Mar 2016 18:15:20 +0100 Subject: [PATCH 5/6] Move YoutubeStreamPreviewInfoExtractor to separate class The class should be separate because channel support in the future would require video preview extraction too, which doesn't differ much from the extraction done from the search results. --- .../services/youtube/YoutubeSearchEngine.java | 122 +--------------- .../YoutubeStreamPreviewInfoExtractor.java | 135 ++++++++++++++++++ 2 files changed, 136 insertions(+), 121 deletions(-) create mode 100644 app/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeStreamPreviewInfoExtractor.java diff --git a/app/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeSearchEngine.java b/app/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeSearchEngine.java index 39cb42d7d..a81aa8ce7 100644 --- a/app/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeSearchEngine.java +++ b/app/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeSearchEngine.java @@ -187,126 +187,6 @@ public class YoutubeSearchEngine extends SearchEngine { } private StreamPreviewInfoExtractor extractPreviewInfo(final Element item) { - return new StreamPreviewInfoExtractor() { - @Override - public String getWebPageUrl() throws ParsingException { - try { - Element el = item.select("div[class*=\"yt-lockup-video\"").first(); - Element dl = el.select("h3").first().select("a").first(); - return dl.attr("abs:href"); - } catch (Exception e) { - throw new ParsingException("Could not get web page url for the video", e); - } - } - - @Override - public String getTitle() throws ParsingException { - try { - Element el = item.select("div[class*=\"yt-lockup-video\"").first(); - Element dl = el.select("h3").first().select("a").first(); - return dl.text(); - } catch (Exception e) { - throw new ParsingException("Could not get title", e); - } - } - - @Override - public int getDuration() throws ParsingException { - try { - return YoutubeParsingHelper.parseDurationString( - item.select("span[class=\"video-time\"]").first().text()); - } catch(Exception e) { - if(isLiveStream(item)) { - // -1 for no duration - return -1; - } else { - throw new ParsingException("Could not get Duration", e); - } - - - } - } - - @Override - public String getUploader() throws ParsingException { - try { - return item.select("div[class=\"yt-lockup-byline\"]").first() - .select("a").first() - .text(); - } catch (Exception e) { - throw new ParsingException("Could not get uploader", e); - } - } - - @Override - public String getUploadDate() throws ParsingException { - try { - return item.select("div[class=\"yt-lockup-meta\"]").first() - .select("li").first() - .text(); - } catch(Exception e) { - throw new ParsingException("Could not get uplaod date", e); - } - } - - @Override - public long getViewCount() throws ParsingException { - String output; - String input; - try { - input = item.select("div[class=\"yt-lockup-meta\"]").first() - .select("li").get(1) - .text(); - } catch (IndexOutOfBoundsException e) { - if(isLiveStream(item)) { - // -1 for no view count - return -1; - } else { - throw new ParsingException( - "Could not parse yt-lockup-meta although available", e); - } - } - - output = Parser.matchGroup1("([0-9,\\. ]*)", input) - .replace(" ", "") - .replace(".", "") - .replace(",", ""); - - try { - return Long.parseLong(output); - } catch (NumberFormatException e) { - // if this happens the video probably has no views - if(!input.isEmpty()) { - return 0; - } else { - throw new ParsingException("Could not handle input: " + input, e); - } - } - } - - @Override - public String getThumbnailUrl() throws ParsingException { - try { - String url; - Element te = item.select("div[class=\"yt-thumb video-thumb\"]").first() - .select("img").first(); - url = te.attr("abs:src"); - // Sometimes youtube sends links to gif files which somehow seem to not exist - // anymore. Items with such gif also offer a secondary image source. So we are going - // to use that if we've caught such an item. - if (url.contains(".gif")) { - url = te.attr("abs:data-thumb"); - } - return url; - } catch (Exception e) { - throw new ParsingException("Could not get thumbnail url", e); - } - } - - private boolean isLiveStream(Element item) { - Element bla = item.select("span[class*=\"yt-badge-live\"]").first(); - return bla != null; - } - }; + return new YoutubeStreamPreviewInfoExtractor(item); } } diff --git a/app/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeStreamPreviewInfoExtractor.java b/app/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeStreamPreviewInfoExtractor.java new file mode 100644 index 000000000..9c140a46d --- /dev/null +++ b/app/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeStreamPreviewInfoExtractor.java @@ -0,0 +1,135 @@ +package org.schabi.newpipe.extractor.services.youtube; + +import org.jsoup.nodes.Element; +import org.schabi.newpipe.extractor.Parser; +import org.schabi.newpipe.extractor.ParsingException; +import org.schabi.newpipe.extractor.StreamPreviewInfoExtractor; + +public class YoutubeStreamPreviewInfoExtractor implements StreamPreviewInfoExtractor { + + private final Element item; + + public YoutubeStreamPreviewInfoExtractor(Element item) { + this.item = item; + } + + @Override + public String getWebPageUrl() throws ParsingException { + try { + Element el = item.select("div[class*=\"yt-lockup-video\"").first(); + Element dl = el.select("h3").first().select("a").first(); + return dl.attr("abs:href"); + } catch (Exception e) { + throw new ParsingException("Could not get web page url for the video", e); + } + } + + @Override + public String getTitle() throws ParsingException { + try { + Element el = item.select("div[class*=\"yt-lockup-video\"").first(); + Element dl = el.select("h3").first().select("a").first(); + return dl.text(); + } catch (Exception e) { + throw new ParsingException("Could not get title", e); + } + } + + @Override + public int getDuration() throws ParsingException { + try { + return YoutubeParsingHelper.parseDurationString( + item.select("span[class=\"video-time\"]").first().text()); + } catch(Exception e) { + if(isLiveStream(item)) { + // -1 for no duration + return -1; + } else { + throw new ParsingException("Could not get Duration", e); + } + + + } + } + + @Override + public String getUploader() throws ParsingException { + try { + return item.select("div[class=\"yt-lockup-byline\"]").first() + .select("a").first() + .text(); + } catch (Exception e) { + throw new ParsingException("Could not get uploader", e); + } + } + + @Override + public String getUploadDate() throws ParsingException { + try { + return item.select("div[class=\"yt-lockup-meta\"]").first() + .select("li").first() + .text(); + } catch(Exception e) { + throw new ParsingException("Could not get uplaod date", e); + } + } + + @Override + public long getViewCount() throws ParsingException { + String output; + String input; + try { + input = item.select("div[class=\"yt-lockup-meta\"]").first() + .select("li").get(1) + .text(); + } catch (IndexOutOfBoundsException e) { + if(isLiveStream(item)) { + // -1 for no view count + return -1; + } else { + throw new ParsingException( + "Could not parse yt-lockup-meta although available", e); + } + } + + output = Parser.matchGroup1("([0-9,\\. ]*)", input) + .replace(" ", "") + .replace(".", "") + .replace(",", ""); + + try { + return Long.parseLong(output); + } catch (NumberFormatException e) { + // if this happens the video probably has no views + if(!input.isEmpty()) { + return 0; + } else { + throw new ParsingException("Could not handle input: " + input, e); + } + } + } + + @Override + public String getThumbnailUrl() throws ParsingException { + try { + String url; + Element te = item.select("div[class=\"yt-thumb video-thumb\"]").first() + .select("img").first(); + url = te.attr("abs:src"); + // Sometimes youtube sends links to gif files which somehow seem to not exist + // anymore. Items with such gif also offer a secondary image source. So we are going + // to use that if we've caught such an item. + if (url.contains(".gif")) { + url = te.attr("abs:data-thumb"); + } + return url; + } catch (Exception e) { + throw new ParsingException("Could not get thumbnail url", e); + } + } + + private boolean isLiveStream(Element item) { + Element bla = item.select("span[class*=\"yt-badge-live\"]").first(); + return bla != null; + } +} From 1bd660fbbe79e73dc237ac6d9c801ada7190ed83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mladen=20Pejakovi=C4=87?= Date: Fri, 11 Mar 2016 15:35:05 +0100 Subject: [PATCH 6/6] Translated using Weblate (Serbian) Currently translated at 98.1% (104 of 106 strings) --- app/src/main/res/values-sr/strings.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/src/main/res/values-sr/strings.xml b/app/src/main/res/values-sr/strings.xml index 05835492a..78cf4fab3 100644 --- a/app/src/main/res/values-sr/strings.xml +++ b/app/src/main/res/values-sr/strings.xml @@ -121,4 +121,7 @@ Не могох да потражим декодере уређаја Не могох да покренем декодер %1$s Дозвола за приступ складишту је одбијена + Пријавите грешку + Извештај корисника +