Compare commits
10
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f2ac845797 | ||
|
|
a85e55a594 | ||
|
|
e2775db4e5 | ||
|
|
589e8928a0 | ||
|
|
cd189b1dda | ||
|
|
14c111a3e6 | ||
|
|
b506c56346 | ||
|
|
bbbc94e510 | ||
|
|
8cb2c380e7 | ||
|
|
b9879f9ed7 |
+2
-2
@@ -91,8 +91,8 @@ task testClasses {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'com.microsoft.appcenter:appcenter-analytics:5.0.1'
|
||||
implementation 'com.microsoft.appcenter:appcenter-crashes:5.0.1'
|
||||
implementation 'com.microsoft.appcenter:appcenter-analytics:5.0.2'
|
||||
implementation 'com.microsoft.appcenter:appcenter-crashes:5.0.2'
|
||||
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.3'
|
||||
implementation 'net.sourceforge.streamsupport:streamsupport-minifuture:1.7.4'
|
||||
implementation 'com.google.guava:guava:23.3-android'
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package ru.vtosters.lite.music.cache;
|
||||
|
||||
import android.os.RemoteException;
|
||||
import android.text.TextUtils;
|
||||
import bruhcollective.itaysonlab.libvkx.ILibVkxService;
|
||||
import bruhcollective.itaysonlab.libvkx.client.LibVKXClient;
|
||||
import bruhcollective.itaysonlab.libvkx.client.LibVKXClientImpl;
|
||||
@@ -17,7 +18,7 @@ public class MusicCacheImpl {
|
||||
track.y1(),
|
||||
track.I != null ? track.I.getId() + "" : "-1",
|
||||
track.f,
|
||||
track.g,
|
||||
!TextUtils.isEmpty(track.g) ? track.g : "",
|
||||
track.C,
|
||||
track.I != null ? track.I.getTitle() : "",
|
||||
track.K,
|
||||
|
||||
@@ -1,9 +1,15 @@
|
||||
package ru.vtosters.lite.music.converter.ts;
|
||||
|
||||
import com.arthenica.ffmpegkit.FFmpegKit;
|
||||
import com.vk.dto.music.Artist;
|
||||
import com.vk.dto.music.MusicTrack;
|
||||
import ru.vtosters.hooks.other.Preferences;
|
||||
import ru.vtosters.lite.music.downloader.M3UDownloader;
|
||||
import ru.vtosters.lite.utils.IOUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.text.Normalizer;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class FFMpeg {
|
||||
|
||||
@@ -13,47 +19,26 @@ public class FFMpeg {
|
||||
* @param track Track to be converted
|
||||
* @return True if success, else false
|
||||
*/
|
||||
public static void convert(File in, String out, MusicTrack track) throws Throwable {
|
||||
public static void convert(File in, String out, MusicTrack track) {
|
||||
// convert .ts file to .mp3 file via ffmpeg
|
||||
var cmd = " -y -i \"" + in.getAbsolutePath() + '"'
|
||||
+ " -map 0 -dn"
|
||||
+ " -loglevel error"
|
||||
+ " -hide_banner"
|
||||
+ " -write_id3v2 1"
|
||||
// +" -metadata title=\""+IOUtils.getValidFileName(M3UDownloader.getTitle(track))+'"'
|
||||
// +" -metadata artist=\""+normalizeMetadata(track.L.stream().map(Artist::w1).collect(Collectors.joining(", ")))+'"'
|
||||
// +" -metadata album=\""+normalizeMetadata(track.I.getTitle())+'"'
|
||||
+ setMetadata(track)
|
||||
+ " -c copy \"" + out + '"';
|
||||
var ses = FFmpegKit.execute(cmd);
|
||||
if (ses.getReturnCode().isValueCancel()) throw new RuntimeException(ses.getLogsAsString());
|
||||
}
|
||||
|
||||
private static String normalizeMetadata(String in) {
|
||||
return in.replace('"', '‟');
|
||||
private static String setMetadata(MusicTrack track) {
|
||||
return Preferences.getBoolValue("setMetaData", false) ? " -metadata title=\"" + IOUtils.getValidFileName(M3UDownloader.getTitle(track)) + '"'
|
||||
+ " -metadata artist=\"" + normalizeMetadata(track.L.stream().map(Artist::w1).collect(Collectors.joining(", "))) + '"'
|
||||
+ " -metadata album=\"" + normalizeMetadata(track.I.getTitle()) + '"' : "";
|
||||
}
|
||||
|
||||
// private static void copyAssets()
|
||||
// throws IOException
|
||||
// {
|
||||
// try
|
||||
// {
|
||||
// for (var filename:AndroidUtils.getGlobalContext().getAssets().list("ffmpeg"))
|
||||
// if(filename.endsWith(".so"))
|
||||
// IOUtils.writeToFile(
|
||||
// new File(AndroidUtils.getGlobalContext().getFilesDir(),filename),
|
||||
// IOUtils.readFully(AndroidUtils.getGlobalContext().getAssets().open("ffmpeg"+File.separator+filename)));
|
||||
// }
|
||||
// catch(IOException e)
|
||||
// { throw e; }
|
||||
// }
|
||||
//
|
||||
// private static void checkFFMpegLibs()
|
||||
// {
|
||||
// var lib=new File(AndroidUtils.getGlobalContext().getFilesDir(),"libffmpegkit_abidetect.so");
|
||||
// if(!lib.exists())
|
||||
// {
|
||||
// ToastUtils.a(R.string.ffmpegkit_copy);
|
||||
// copyAssets();
|
||||
// }
|
||||
// }
|
||||
private static String normalizeMetadata(String in) {
|
||||
return in.replaceAll("[\\\\/:*?\"<>|]", "");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -136,7 +136,7 @@ public class M3UDownloader
|
||||
}
|
||||
|
||||
public static String getTitle(MusicTrack track) {
|
||||
return track.f + (!TextUtils.isEmpty(track.g) ? +'(' + track.g + ')' : null);
|
||||
return track.f + (!TextUtils.isEmpty(track.g) ? + '(' + track.g + ')' : "");
|
||||
}
|
||||
|
||||
static File getTsesDir(MusicTrack track) {
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -5615,7 +5615,7 @@ Warning! It can cause long downloads of user lists if there are a lot of users i
|
||||
<string name="ctypesocks">Socks</string>
|
||||
<string name="dnr">Do not read</string>
|
||||
<string name="dns">Disable status of viewing</string>
|
||||
<string name="dnw">Do not write</string>
|
||||
<string name="dnw">Do not type</string>
|
||||
<string name="docknumbers">Counters in dockbar</string>
|
||||
<string name="docknumberssum">"Disabling doesn't work in the tablet interface"</string>
|
||||
<string name="dockbar_tab_titles">Show dockbar item titles</string>
|
||||
@@ -5879,7 +5879,7 @@ May look like a fake leaving the online"</string>
|
||||
|
||||
<string name="activity_what_is_it">What is it?</string>
|
||||
<string name="activity_dnr_summary">Function lets you don\'t send read message status</string>
|
||||
<string name="activity_dnw_summary">Function lets you don\'t send write message status</string>
|
||||
<string name="activity_dnw_summary">Function lets you don\'t send type message status</string>
|
||||
<string name="activity_dns_summary">Function lets you don\'t send read stories status</string>
|
||||
|
||||
<string name="activity_dnr_visual">Visually may not work correctly (locally read), but companion will see that it wasn\'t read.</string>
|
||||
|
||||
@@ -45,6 +45,11 @@
|
||||
android:entryValues="@array/musicdefcatalog"
|
||||
android:key="musicdefcatalog"
|
||||
android:title="@string/musicdefcatalog_title"/>
|
||||
<com.vtosters.lite.ui.MaterialSwitchPreference
|
||||
android:defaultValue="false"
|
||||
android:key="setMetaData"
|
||||
android:summary="Сохранять id3v2 теги для песен для MP3 (Экспериментально)"
|
||||
android:title="Сохранять метадату песен"/>
|
||||
<Preference
|
||||
android:key="audio_download"
|
||||
android:title="@string/audio_download_title"/>
|
||||
|
||||
@@ -354,6 +354,16 @@
|
||||
.method static a(Landroid/content/Context;Ljava/lang/String;)V
|
||||
.locals 11
|
||||
|
||||
const-string v0, "hideDeviceInfo"
|
||||
|
||||
sget-object v1, Ljava/lang/Boolean;->TRUE:Ljava/lang/Boolean;
|
||||
|
||||
invoke-static {v0, v1}, Lru/vtosters/hooks/other/Preferences;->getBoolValue(Ljava/lang/String;Ljava/lang/Boolean;)Z
|
||||
|
||||
move-result v0
|
||||
|
||||
if-nez v0, :cond_1
|
||||
|
||||
if-eqz p0, :cond_0
|
||||
|
||||
if-eqz p1, :cond_0
|
||||
|
||||
Reference in New Issue
Block a user