AdrianEddy / AIMPYouTube

YouTube plugin for AIMP
MIT License
111 stars 37 forks source link

Internal links plugin #6

Open Dharmainiciativ opened 7 years ago

Dharmainiciativ commented 7 years ago

Big request to the author, please don't change the format of the playlist to address tracks type youtube:// Get, when you export such playlists they can no longer read third-party players, including video. BTW with the plugin Souncloud too problems stopped taking links

AdrianEddy commented 7 years ago

Hi, This format is needed to support all new features in AIMP 4.10 like drag&crop, copy to clipboard and open file location. However, I can add a separate menu option to export the playlist with normal URLs. Which playlist format are you interested in? Do you need full youtube urls like https://www.youtube.com/watch?v=[id] or the direct link to .mp4 file (ie. processed link). The processed links to .mp4 files are unfortunately temporary (so they will expire at some point), but the advantage is that they can be played by any mp3/mp4 player (even without special youtube support).

Dharmainiciativ commented 7 years ago

I need to address in the Youtube playlist have the same form as in the example below

EXTM3U

EXTINF: -1, Georges Brassens Les copains d'abord

https://www.youtube.com/watch?v=CWJmBBxJlig Format links need just such, otherwise the other players will appreciate it. Export links in a format better m3u8 and m3u, different characters may appear in the titles. Interest in your plugin arose from the fact that it bypasses the restriction to 200 tracks from the playlist. Other players, such as PotPlayer or MPC-BE if they open a link on the playlist receive only 200 tracks. Your plugin also circumvents this limitation. P.S today released a new version of the AIMP, and hope you will be able to correct the behavior of the plugin. Unfortunately today at the closing of the player it gives AIMP.exe window: Memory Leak Detected Thanks for the quick response and the desire to help, looking forward to new versions of Youtube and Souncloud plugins.

Dharmainiciativ commented 7 years ago

I have good news for you by the plugin to version AIMP 4.12.1873 no longer get out error when closing AIMP.exe player: Memory Leak Detected

AdrianEddy commented 7 years ago

Actually, here's a quick script to convert the playlist file from youtube:// format to full youtube url: It works for soundcloud too. Just save it as convert-pls.js and drag&drop your playlist file over it.

if (WScript.Arguments.Count() > 0) {
    var filename = WScript.Arguments(0);
    var fso = WScript.CreateObject('Scripting.FileSystemObject');

    var f = fso.OpenTextFile(filename, 1, false, -2); // 1 - forReading
    var content = f.AtEndOfStream ? '' : f.ReadAll();
    f.close();
    if (content) {
        content = content.replace(/youtube:\/\/(.*?)\/.*?(\r?\n)/gi, 'https://www.youtube.com/watch?v=$1$2');
        content = content.replace(/soundcloud:\/\/(.*?)\/.*?(\r?\n)/gi, 'https://api.soundcloud.com/tracks/$1/stream?client_id=7ab49ecff90c309cd51cab81c1f5baed$2');

        f = fso.OpenTextFile(filename, 2, true, -2); // 2 - forWriting
        f.write(content);
        f.close();
    }
}
Dharmainiciativ commented 7 years ago

Thank you for you script. I will try to explain why you should not export links, where the address is registered as follows YouTube: // If you open the exported playlist Aimp, we get a picture of how the screenshot clipboard I will try to explain why you should not export links, where the address is registered as follows YouTube: // If you open the exported playlist Aimp, we get the picture as a screenshot. Therefore, I suggest the following: When you export to a format aimppl4 save links in the form of YouTube: // as the problem with him Images For other formats, convert them https://www.youtube.com/watch?v=[id] P.S The latest version of the plugin Souncloud unfortunately does not work. It throws an error when you try to create a playlist Could not resolve the address