ingest: weight yt-dlp sources with an optional WEIGHT:URL prefix
Source lines may now start with a numeric weight (e.g. 3:https://…) to bias how often each is drawn. The prefix is unambiguous since a URL scheme can never be numeric; unprefixed lines default to weight 1 and a weight of 0 disables the line. Selection uses Efraimidis-Spirakis weighted sampling without replacement, preserving the fall-through to the next source when one fails. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
8054c98dd1
commit
5dd50f37b7
3 changed files with 64 additions and 10 deletions
|
|
@ -7,8 +7,16 @@
|
|||
# -> radieo y pioche un morceau au hasard à chaque tour,
|
||||
# en évitant ceux joués récemment.
|
||||
#
|
||||
# Poids (optionnel) : préfixer la ligne par `POIDS:URL` pour ajuster la
|
||||
# fréquence de tirage d'une source. Sans préfixe, le poids vaut 1. Le poids est
|
||||
# relatif aux autres lignes ; un poids de 0 désactive la ligne. La lecture est
|
||||
# non ambiguë : un schéma d'URL ne peut jamais être un nombre.
|
||||
# 3:https://… -> tirée 3× plus souvent qu'une ligne de poids 1
|
||||
# 0.5:https://… -> tirée 2× moins souvent
|
||||
# 0:https://… -> désactivée
|
||||
#
|
||||
# Exemples (à remplacer par les tiens) :
|
||||
# https://www.youtube.com/watch?v=dQw4w9WgXcQ
|
||||
# https://soundcloud.com/artiste/un-morceau
|
||||
# 2:https://soundcloud.com/artiste/un-morceau
|
||||
# https://artiste.bandcamp.com/album/un-album
|
||||
# https://www.youtube.com/playlist?list=PLxxxxxxxx
|
||||
# 3:https://www.youtube.com/playlist?list=PLxxxxxxxx
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue