Mopidy-InternetArchive¶
Mopidy-InternetArchive is a Mopidy extension for playing music from the Internet Archive.
This extension lets you search for and stream recordings ranging from alternative news programming, to Grateful Dead concerts, to Old Time Radio shows, to book and poetry readings, to original music uploaded by Internet Archive users. Last but not least, it gives you access to a vast collection of high-quality free live recordings from the Live Music Archive.
Introduction¶
About the Internet Archive Metadata Model¶
Note
This is just a brief introduction to get you accustomed to some basic Internet Archive concepts and terminology related to this Mopidy extension. For more in-depth information, please refer to the FAQ, or start with this blog post.
Files published on the Internet Archive are organized in so-called items. An item is a directory or folder that includes the originally uploaded content – audio, video, text, etc. – along with any derivative files created from the originals, and some metadata that describes the item. An item may contain a single audio file, or a related set of audio files that represent a CD or a taped live concert. All the files within an item have the same metadata, such as (album) title, creator, description, and so on. For the purpose of this Mopidy extension, Internet Archive items are treated as albums, and the included audio files show up as the album’s tracks.
Every item also has a unique identifier, which can be used to access the item on the Internet Archive’s Web site:
http://archive.org/details/{identifier}
In Mopidy, you may encounter item identifiers in an album URI’s path, while individual tracks add the respective file name as their URI’s fragment.
Besides items containing media files, there are also collections, which are used to to group related items. The Live Music Archive, for example, is the collection with the identifier etree. An item can be a member of more than one collection, and collections may also have sub-collections. Within the Live Music Archive, there exist sub-collections for all artists that gave permission for live show recordings to be hosted on archive.org, such as the Grateful Dead or the Smashing Pumpkins, while the Live Music Archive itself is a sub-collection of the larger Audio Archive. Within Mopidy, collections most prominently show up as top-level directories when browsing the Internet Archive, but can also be used to exclude specific items from searching and browsing [1].
Browsing the Internet Archive¶
Starting with version 0.18, Mopidy also provides the possiblity to
browse directories and tracks. If your client supports this, there
should be a virtual directory named Internet Archive. When
browsing, Internet Archive items are structured into a hierarchy three
levels deep. At the top level, you will find the collections
configured under internetarchive/collections
, and you will
be able to browse individual audio items (albums) and files (tracks)
within these.
For practical and performance reasons, the number of audio items that
will be shown within a collection is limited, e.g. you will not see
all 144,957 items of the Live Music Archive [2]. The
default configuration sets this limit to 100, but
this can be changed with internetarchive/browse_limit
.
Items are selected based on popularity by default, i.e. the 100 most
downloaded items will be listed for each collection. This can also be
changed using internetarchive/browse_order
, e.g. to always
show the latest additions to the Archive.
Searching the Internet Archive¶
The Internet Archive only supports searching for items, but not for individual files or tracks. Therefore, only albums will show up when searching in Mopidy, which may not be handled correctly by your client. This also means that only album-related search fields are supported, i.e. searching for track names or numbers will yield no results from the Internet Archive.
The number and ordering of search results returned from the Internet
Archive can be changed with internetarchive/search_limit
and internetarchive/search_order
, similar to the settings
used for browsing.
Archive Bookmarks¶
If you have an Internet Archive account - also termed a Virtual
Library Card - you can access your Archive Bookmarks from Mopidy.
To do so, you need to add your Internet Archive user name to Mopidy’s
configuration as internetarchive/username
. Your bookmarks
will then appear in the top-level browse directory as Archive
Bookmarks.
Note
It is currently not possible to edit your Archive Bookmarks using Mopidy. This restriction may be removed in future versions.
Footnotes
[1] | If you really don’t like the Grateful Dead, for example. |
[2] | As of 2015-09-11. |
Installation¶
Mopidy-InternetArchive can be installed using pip by running:
pip install Mopidy-InternetArchive
Configuration¶
This extension has a number of configuration values that can be tweaked. However, the default configuration contains everything to get you up and running, and will usually require only a few modifications to match personal preferences.
Configuration Values¶
-
internetarchive/base_url
¶ Base URL to access the Internet Archive.
-
internetarchive/username
¶ Your archive.org user name. This is only needed if you want to access your Internet Archive bookmarks from Mopidy.
-
internetarchive/collections
¶ A list of collection identifiers to show as top-level directories when browsing.
-
internetarchive/audio_formats
¶ A list of audio file formats, in order of preference.
This entry contains a list of Internet Archive file formats. By default, only audio formats suitable for streaming are requested. Note that the Internet Archive also contains a large number of high-quality media files in FLAC and other lossless formats, but for sake of bandwidth (both your’s and the Archive’s), it is recommended that you stick to lossy audio formats for streaming through Mopidy.
-
internetarchive/image_formats
¶ A list of image file formats, in order of preference.
This entry contains a list of Internet Archive file formats to be considered when providing images for Internet Archive items. Note that some Mopidy clients, especially MPD clients, will ignore album art provided by Mopidy-InternetArchive or other Mopidy extensions.
-
internetarchive/browse_limit
¶ The maximum number of browse results.
This is used to limit the number of items returned when browsing the Internet Archive.
-
internetarchive/browse_order
¶ The sort order used when browsing the Internet Archive.
-
internetarchive/search_limit
¶ The maximum number of search results.
This is used to limit the number of items returned when searching the Internet Archive.
-
internetarchive/search_order
¶ The sort order used when searching the Internet Archive.
-
internetarchive/exclude_collections
¶ A list of collection identifiers to exclude when searching or browsing.
-
internetarchive/exclude_mediatypes
¶ A list of Internet Archive media types to exclude when searching or browsing.
-
internetarchive/cache_size
¶ The number of Internet Archive items to cache in memory.
-
internetarchive/cache_ttl
¶ The cache time-to-live in seconds.
-
internetarchive/retries
¶ The maximum number of retries each HTTP connection should attempt.
-
internetarchive/timeout
¶ The timeout in seconds for HTTP requests to the Internet Archive.
Sort Order Fields¶
The sort order for searching and browsing is given as <fieldname>
(asc|desc)
, where <fieldname>
is one of:
- addeddate
- avg_rating
- call_number
- createdate
- creatorSorter
- date
- downloads
- foldoutcount
- headerImage
- identifier
- imagecount
- indexdate
- languageSorter
- licenseurl
- month
- nav_order
- num_reviews
- publicdate
- reviewdate
- stars
- titleSorter
- week
- year
Default Configuration¶
For reference, this is the default configuration shipped with Mopidy-InternetArchive release 1.3.0:
[internetarchive]
enabled = true
# archive.org base URL
base_url = http://archive.org
# archive.org user name, to access bookmarks as playlists
username =
# top-level collections for browsing
collections =
audio
audio_bookspoetry
opensource_audio
audio_tech
GratefulDead
etree
audio_music
netlabels
audio_news
audio_foreign
audio_podcast
radioprograms
audio_religion
# audio file formats in order of preference
audio_formats = VBR MP3, 64Kbps MP3
# image file formats in order of preference
image_formats = JPEG, JPEG Thumb
# maximum number of browse results
browse_limit = 100
# sort order for browsing: <fieldname> (asc|desc)
browse_order = downloads desc
# maximum number of search results
search_limit = 20
# sort order for searching: <fieldname> (asc|desc); default is score
search_order =
# list of collections to exclude from searching and browsing
exclude_collections =
# list of media types to exclude from searching and browsing
exclude_mediatypes =
# number of items to cache
cache_size = 128
# cache time-to-live in seconds
cache_ttl = 86400
# maximum number of HTTP connection retries
retries = 3
# HTTP request timeout in seconds
timeout = 10
License¶
Mopidy-InternetArchive is Copyright (c) 2014, 2015 Thomas Kemmer.
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this software except in compliance with the License. You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.