Giter Club home page Giter Club logo

playlistsnet's People

Contributors

0xced avatar 1hitsong avatar erri120 avatar jonathan-haubrich avatar maxkatz6 avatar tmk907 avatar xxbiohazrdxx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

playlistsnet's Issues

Comments in m3u format are read into entries

If you try to create a m3u playlist with comments (eg: #PLAYLIST-Author:Gandalf), the comments are read and stored into entries and not into playlist.Comments.
A side effect of this issue is, that if you save a playlist with no entries as a m3u file, the comments will not be read, 'cause there are no entries in the playlist.

Cannot get HlsMediaPlaylist

HlsMediaContent videoContent = new();
var videoFiles = videoContent.GetFromString(video);

Getting Value was either too large or too small for an Int32 on GetFromString().

Add encoding parameter to IPlaylistParser.GetFromStream()

I'm using PlaylistsNET for loading M3U files (not the m3u8 UTF-8 encoded variant) by invoking M3uContent.GetFromStream() and supplying a FileStream. GetFromStream() is using a StreamReader to read the stream, and it will use UTF-8 encoding as default. But this produces Mojibake, since the content of the M3U file is not encoded in UTF-8:
Unbenannt
Here's the zipped M3U in question

My workaround right now is to use the file extension to detect the encoding and then use that information to instanciate a StreamReader myself:

// Guess the encoding from the extension. M3U8 is UTF8, the original M3U is not specified, using Latin1 here (fingers crossed)
Encoding encoding = Path.GetExtension(file).ToLower() == ".m3u" ? Encoding.Latin1 : Encoding.UTF8;

M3uContent m3u = new();
string data = new StreamReader(stream, encoding).ReadToEnd();
M3uPlaylist playlist = m3u.GetFromString(data);

So it would be nice to be able to provide a encoding for parsing...

Utils.MakeAbsolutePath() breaks UNC paths

The Utils.MakeAbsolutePath() breaks UNC paths by adding the drive letter from which the invoking .exe is executed.

Example:
MakeAbsolutePath(@"E:\", @"\\server\share\file.ext")
Actual result:
"D:\\server\\share\\file.ext"
Expected result:
"\\\\server\\share\\file.ext"

AFAIK UNC paths are already absolute (except starting with \\.\), so IMHO Utils.IsAbsolutePath() should treat UNC paths starting with \\ and not with \\.\ as absolute paths. MakeAbsolutePath() would then return immediately returning the given path.

EXT-X-VERSION can be optional in HlsMasterContent

when try to parse an HlsMasterContent, it throws exception saying "Playlist missing required EXT-X-VERSION tag."

I think a hls master play list file should be valid without EXT-X-VERSION, it's optional

System.FormatException: Playlist missing required EXT-X-VERSION tag.

A format exception is currently being thrown when the EXT-X-VERSION tag is not included in the response for a Master Playlist. Looking at the specification, it seems that this is an optional tag which should only be available when tags or attributes that are not compatible with protocol version 1 is used.
https://tools.ietf.org/html/rfc8216#section-7

Sample master playlist without the EXT-X-VERSION tag
https://tools.ietf.org/html/rfc8216#section-8.4

Can we update the check so it does not enforce an EXT-X-VERSION check on https://github.com/tmk907/PlaylistsNET/blob/master/PlaylistsNET/Content/HlsContent.cs#L33 ?

VLC m3u8 encoding

(jellyfin/jellyfin/issues/4439)

VLC encodes .m3u8 playlist files, eg when having a song at Aimer/春はゆく - marie/01 - 春はゆく.flac it gets encoded like this:

#EXTINF:304,Aimer - 春はゆく
Aimer/%E6%98%A5%E3%81%AF%E3%82%86%E3%81%8F%20-%20marie/01%20-%20%E6%98%A5%E3%81%AF%E3%82%86%E3%81%8F.flac

Tbh this isn't really a problem with your library but with VLC as every program except VLC fails at reading these playlist files. (https://git.videolan.org/?p=vlc.git;a=blob;f=modules/demux/playlist/playlist.c#l178 and https://git.videolan.org/?p=vlc.git;a=blob;f=include/vlc_url.h;h=68a663fb030d4a7bd7343934510dffa3f19f07df;hb=HEAD#l142)

GetTracksPaths Strips Plus Sign Character

GetTracksPaths is removing a plus sign (+) from a folder name.

I have a playlist that contains:
#EXTINF:0,01 - Gonna Make You Sweat (Everybody Dance Now).mp3
.\C+C Music Factory\Gonna Make You Sweat\01 - Gonna Make You Sweat (Everybody Dance Now).mp3

When I execute the following code:
PlaylistsNET.Content.M3uContent content = new PlaylistsNET.Content.M3uContent();
using (StreamReader sr = new StreamReader(@"M:\Test_Playlist.m3u"))
{
PlaylistsNET.Models.M3uPlaylist MyPlaylist = content.GetFromStream(sr.BaseStream);
foreach (var track in MyPlaylist.GetTracksPaths())
{
Console.WriteLine(track);
}
}

I see:
.\C C Music Factory\Gonna Make You Sweat\01 - Gonna Make You Sweat (Everybody Dance Now).mp3

Thanks.
Steve

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.