Skip to content

Commit

Permalink
feat: change index playlist extension to m3u
Browse files Browse the repository at this point in the history
Change playlist of playlists endpoint extension from m3u8 to m3u.
  • Loading branch information
mgoltzsche committed Mar 17, 2024
1 parent c037ea5 commit ec07df6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,22 +54,22 @@ Options:
The following endpoints allow listing and downloading playlist as well as audio files:
* `GET /playlists/index.m3u8[?uri-format=$url]`: Returns a playlist that contains the URLs of other playlists.
* `GET /playlists/index.m3u[?uri-format=$url]`: Returns the playlist of playlists.
* `GET /playlists/`: List available playlists.
* `GET /playlists/*.m3u8[?uri-format=$url]`: Get/download a playlist.
* `GET /playlists/*.m3u[?uri-format=$url]`: Get/download a playlist.
* `GET /audio/`: List available audio files.
* `GET /audio/*.opus`: Download/stream an audio file.
The `uri-format` parameter allows specifying a playlist item URI template.
Item attribute names prefixed with a `$` can be used as placeholders, e.g. `subsonic:track:$id`.
`$url` is a built-in placeholder.
Item field names prefixed with a `$` can be used as placeholders, e.g. `beets:library:track;$id`.
`$url` is a built-in placeholder and the default value.
The list endpoints return either a JSON or HTML response, supporting content type negotiation.
A JSON response body looks as follows:
```json
{
"directories": [{"name":"some-dir"}],
"files": [{"name":"Afrobeat", "url":"afrobeat.m3u8"}],
"files": [{"name":"afrobeat", "url":"afrobeat.m3u"}],
}
```

Expand Down
2 changes: 1 addition & 1 deletion beetsplug/webm3u/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

_format_regex = re.compile(r'\$[a-z0-9_]+')

@bp.route('/playlists/index.m3u8')
@bp.route('/playlists/index.m3u')
def playlist_index():
uri_format = request.args.get('uri-format')
playlist_dir = playlist_provider().dir
Expand Down
2 changes: 1 addition & 1 deletion beetsplug/webm3u/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ <h1>Beets music library</h1>
<li><a href="audio/">Audio files</a></li>
</ul>
<p>
<a href="playlists/index.m3u8">Playlist of playlists</a>
<a href="playlists/index.m3u">Playlist of playlists</a>
</p>
</body>
</html>

0 comments on commit ec07df6

Please sign in to comment.