get_mp3 | R Documentation |
This function downloads YouTube videos or Soundcloud or any other platform supported by the youtube-dl library, and converts them into high quality MP3 files. The URL can be for a single video or a whole playlist. It also returns metadata into an (invisible) list.
get_mp3(
id,
mp3 = TRUE,
repo = "youtube-dl",
params = "--no-check-certificate",
start_time = 0,
end_time = NA,
overwrite = TRUE,
open = FALSE,
delete = open,
info = TRUE,
cover = FALSE,
quiet = FALSE
)
id |
Character. YouTube URL or ID to search for. |
mp3 |
Boolean. Add mp3 optimal parameters? |
repo |
Character. Chose repository you installed youtube-dl from. Any of: "youtube-dl" (latest stable version), "yt-dlp" (latest dev version). |
params |
Character. Additional parameters. |
start_time , end_time |
Numeric. Start and end time to trim the audio output in seconds. |
overwrite |
Boolean. Overwrite original file? |
open , delete |
Boolean. After everything's done, should the file be opened? Should it be deleted? |
info |
Boolean. Import and return metadata? |
cover |
Boolean. Google Search its squared cover? |
quiet |
Boolean. Keep quiet? If not, print messages. |
(Invisible) list with id's meta-data.
More info from the original developers and its code: youtube-dl's Github
Other Scrapper:
filesGD()
,
gtrends_related()
,
holidays()
,
ip_data()
,
readGS()
,
splot_summary()
,
stocks_quote()
Other Audio:
trim_mp3()
# You must have "youtube-dl" installed in your OS:
## Not run:
# Download video from YouTube and convert to MP3
get_mp3("https://www.youtube.com/watch?v=lrlKcCdVw9Q")
# OR simply
get_mp3("lrlKcCdVw9Q")
# For dev version, use:
get_mp3("m3RX4LJh0iI", repo = "yt-dlp")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.