{"id":7249,"date":"2020-08-21T09:09:29","date_gmt":"2020-08-21T07:09:29","guid":{"rendered":"https:\/\/michlstechblog.info\/blog\/?p=7249"},"modified":"2023-03-06T13:42:54","modified_gmt":"2023-03-06T12:42:54","slug":"youtube-save-the-audio-stream-off-a-youtube-video-as-mp3","status":"publish","type":"post","link":"https:\/\/michlstechblog.info\/blog\/youtube-save-the-audio-stream-off-a-youtube-video-as-mp3\/","title":{"rendered":"Youtube: Save the audio stream of a youtube video as mp3"},"content":{"rendered":"<div class=\"twoclick_social_bookmarks_post_7249 social_share_privacy clearfix 1.6.4 locale-en_US sprite-en_US\"><\/div><div class=\"twoclick-js\"><script type=\"text\/javascript\">\/* <![CDATA[ *\/\njQuery(document).ready(function($){if($('.twoclick_social_bookmarks_post_7249')){$('.twoclick_social_bookmarks_post_7249').socialSharePrivacy({\"services\":{\"flattr\":{\"uid\":\"Michl\",\"status\":\"on\",\"the_title\":\"Youtube%3A%20Save%20the%20audio%20stream%20of%20a%20youtube%20video%20as%20mp3\",\"the_excerpt\":\"Hi%2C%0D%0A%0D%0Athere%20is%20a%20python%20module%20if%20you%20want%20to%20save%20an%20audio%20stream%20of%20a%20youtube.%20youtube-dl%20is%20the%20choice%20for%20such%20tasks.%20%0D%0A%20%28more%26hellip%3B%29\",\"txt_info\":\"2 clicks for more data protection:\\r\\n\\r\\nOnly when you click here, the button will be come active and you can send your recommendation to Flattr. When activating, data are transmitted to third parties. \",\"perma_option\":\"off\"}},\"txt_help\":\"When you activate these fields by clicking, information to Flattr may be transferred abroad, and probably may also stored there.\",\"settings_perma\":\"Enable permanently and accept data transmission. \",\"info_link\":\"http:\\\/\\\/www.heise.de\\\/ct\\\/artikel\\\/2-Klicks-fuer-mehr-Datenschutz-1333879.html\",\"uri\":\"https:\\\/\\\/michlstechblog.info\\\/blog\\\/youtube-save-the-audio-stream-off-a-youtube-video-as-mp3\\\/\",\"post_id\":7249,\"post_title_referrer_track\":\"Youtube%3A+Save+the+audio+stream+of+a+youtube+video+as+mp3\",\"display_infobox\":\"on\"});}});\n\/* ]]> *\/<\/script><\/div><p>Hi,<\/p>\n<p>there is a python module if you want to save an audio stream of a youtube. youtube-dl is the choice for such tasks.<br \/>\n<!--more--><br \/>\nTo install youtube-dl you need python and pip. On Windows use the installer <a href=\"https:\/\/www.python.org\/downloads\/release\" rel=\"noopener noreferrer\" target=\"_blank\">from<\/a><\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nroot@debdev ~ # apt-get install python3 python3-pip\r\n<\/pre>\n<p>Then install youtube-dl in your user profile<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nmichael@debdev ~ # python3 -m pip install youtube-dl\r\n<\/pre>\n<p>Locate your video in your Browser and copy the url.<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nmichael@debdev ~ # ~\/.local\/bin\/youtube-dl --extract-audio --audio-format mp3  'https:\/\/www.youtube.com\/watch?v=f0IxxxY4'\r\n<\/pre>\n<p>Note: You have to update youtube-dl on a regular basis because youtube often changes the web layout. To update youtube-dl call <\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nmichael@debdev ~ # python3 -m pip install youtube-dl\r\n<\/pre>\n<p>again.<br \/>\nIt&#8217;s also possible to download a playlist at once. This command line could start multiple times and skips already downloaded content.<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nmichael@debdev ~ # ~\/.local\/bin\/youtube-dl --download-archive finished.txt --yes-playlist --no-post-overwrites -ciwx --extract-audio --audio-format mp3  'https:\/\/www.youtube.com\/watch?v=myPlaylist&amp;index=20'\r\n<\/pre>\n<p>Michael <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hi, there is a python module if you want to save an audio stream of a youtube. youtube-dl is the choice for such tasks.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,1482],"tags":[360,578,746,157,1483,813],"class_list":["post-7249","post","type-post","status-publish","format-standard","hentry","category-linux","category-youtube","tag-download","tag-mp3","tag-record","tag-save","tag-stream","tag-youtube"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts\/7249","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/comments?post=7249"}],"version-history":[{"count":10,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts\/7249\/revisions"}],"predecessor-version":[{"id":9207,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts\/7249\/revisions\/9207"}],"wp:attachment":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/media?parent=7249"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/categories?post=7249"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/tags?post=7249"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}