Skip to content

Commit 7ff43ca

Browse files
author
chschtsch
committed
tryna merge dem files
1 parent d0877c3 commit 7ff43ca

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

app/src/main/java/org/schabi/newpipe/youtube/YoutubeExtractor.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,8 +288,8 @@ public VideoInfo getVideoInfo(String siteUrl) {
288288
videoInfo.upload_date = doc.select("strong[class=\"watch-time-text\"").first()
289289
.text();
290290

291-
// Try to only use date not the text around it
292-
videoInfo.upload_date = matchGroup1("([0-9.]*$)", videoInfo.upload_date);
291+
// Extracting the date itself from header
292+
videoInfo.upload_date = matchGroup1("([A-Za-z]{3}\\s[\\d]{1,2},\\s[\\d]{4}$)", videoInfo.upload_date);
293293

294294
// description
295295
videoInfo.description = doc.select("p[id=\"eow-description\"]").first()
@@ -320,6 +320,9 @@ public VideoInfo getVideoInfo(String siteUrl) {
320320
// view count
321321
videoInfo.view_count = doc.select("div[class=\"watch-view-count\"]").first().text();
322322

323+
// Extracting the number of views from header
324+
videoInfo.view_count = matchGroup1("([0-9,]*$)", videoInfo.view_count);
325+
323326
// next video
324327
videoInfo.nextVideo = extractVideoInfoItem(doc.select("div[class=\"watch-sidebar-section\"]").first()
325328
.select("li").first());

app/src/main/res/values/strings.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,5 @@
4949
<string name="showNextAndSimilarTitle">Show next and similar videos</string>
5050
<string name="urlNotSupportedText">URL not supported.</string>
5151
<string name="showSimilarVideosButtonText">Similar videos</string>
52-
<string name="contentCountryTitle">Preferable content language</string>
52+
<string name="searchLanguageTitle">Preferable content language</string>
5353
</resources>

0 commit comments

Comments
 (0)