foley.sources.music_library.credit_parser#
Which titles a video credits, by library: the credit-block parser and the titles file.
titles_by_library() reads a video description’s credits (From Epidemic
Sound: blocks, Music by Kevin MacLeod headers, the "Title" Author (site)
attribution form) into {library: [titles]} over the registered libraries’ names
and aliases. titles_from_json() reads a titles file: a list of titles, or
{title: {metadata}}.
Functions
|
The titles a video description credits, by library (default: the registered ones). |
|
A titles file's JSON: a list of titles, or |
- foley.sources.music_library.credit_parser.titles_by_library(description, *, libraries=None)[source]#
The titles a video description credits, by library (default: the registered ones).
A line naming a library (by name or alias, with
From/Music by/Music:and a parenthetical allowed around it) opens its block, and each following line is a title until a blank line; a timestamp, aSong:/Track:label, quotes and bullets are stripped, and links and licence lines skipped. The attribution form ("Title" Kevin MacLeod (incompetech.com)) credits its title wherever it stands.>>> text = '''Music: ... From Epidemic Sound: ... - 0:00 Night Owl ... - Song: "Morning Light" ... https://www.epidemicsound.com/ ... ... "Sneaky Snitch" Kevin MacLeod (incompetech.com) ... Licensed under Creative Commons: By Attribution 4.0 License''' >>> titles_by_library(text) {'epidemic_sound': ['Night Owl', 'Morning Light'], 'incompetech': ['Sneaky Snitch']}