mirror of
https://framagit.org/tom79/nitterizeme
synced 2025-02-09 16:28:51 +01:00
Merge branch 'timestamps-not-handled-fix' into 'develop'
Handle timestamps for shortened youtube links Closes #16 See merge request tom79/nitterizeme!77
This commit is contained in:
commit
09a7bde316
@ -282,9 +282,12 @@ public class Utils {
|
||||
if (invidious_enabled) {
|
||||
Matcher matcher = youtubePattern.matcher(url);
|
||||
while (matcher.find()) {
|
||||
final String youtubeId = matcher.group(3);
|
||||
String youtubeId = matcher.group(3);
|
||||
String invidiousHost = sharedpreferences.getString(MainActivity.SET_INVIDIOUS_HOST, MainActivity.DEFAULT_INVIDIOUS_HOST).toLowerCase();
|
||||
if (Objects.requireNonNull(matcher.group(2)).compareTo("youtu.be") == 0) {
|
||||
if (youtubeId != null && youtubeId.contains("?t=")) {
|
||||
youtubeId = youtubeId.replace("?t=", "&t=");
|
||||
}
|
||||
newUrl = scheme + invidiousHost + "/watch?v=" + youtubeId + "&local=true";
|
||||
} else {
|
||||
newUrl = scheme + invidiousHost + "/" + youtubeId + "&local=true";
|
||||
|
Loading…
x
Reference in New Issue
Block a user