<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: antonio vasconcellos</title>
    <description>The latest articles on DEV Community by antonio vasconcellos (@v0i4).</description>
    <link>https://dev.to/v0i4</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F858818%2Fa803e366-81e1-4135-bb37-c1ddad805b48.jpg</url>
      <title>DEV Community: antonio vasconcellos</title>
      <link>https://dev.to/v0i4</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/v0i4"/>
    <language>en</language>
    <item>
      <title>Downloading YouTube Videos with Elixir</title>
      <dc:creator>antonio vasconcellos</dc:creator>
      <pubDate>Thu, 14 Sep 2023 13:18:48 +0000</pubDate>
      <link>https://dev.to/v0i4/downloading-youtube-videos-with-elixir-2je</link>
      <guid>https://dev.to/v0i4/downloading-youtube-videos-with-elixir-2je</guid>
      <description>&lt;p&gt;We recently had to develop some features that involved downloading videos from YouTube.&lt;/p&gt;

&lt;p&gt;After some research, we found YT-DLP([&lt;a href="https://github.com/yt-dlp/yt-dlp%5D" rel="noopener noreferrer"&gt;https://github.com/yt-dlp/yt-dlp]&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;&lt;em&gt;yt-dlp is a fork of youtube-dl based on the now inactive youtube-dlc. The main focus of this project is to add new features and patches while staying up to date with the original project.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;From this came the idea of writing a simple wrapper around Elixir to facilitate integration with our stack.&lt;/p&gt;

&lt;h2&gt;
  
  
  exyt-dlp
&lt;/h2&gt;

&lt;p&gt;[&lt;a href="https://codeberg.org/v0i4/exyt-dlp" rel="noopener noreferrer"&gt;https://codeberg.org/v0i4/exyt-dlp&lt;/a&gt;]&lt;/p&gt;

&lt;h2&gt;
  
  
  setup
&lt;/h2&gt;

&lt;p&gt;[&lt;a href="https://github.com/yt-dlp/yt-dlp/wiki/Installation" rel="noopener noreferrer"&gt;https://github.com/yt-dlp/yt-dlp/wiki/Installation&lt;/a&gt;]&lt;br&gt;
[&lt;a href="https://hex.pm/packages/exyt_dlp" rel="noopener noreferrer"&gt;https://hex.pm/packages/exyt_dlp&lt;/a&gt;]&lt;/p&gt;

&lt;p&gt;add to your mix.exs file:&lt;br&gt;
{:exyt_dlp, "~&amp;gt; 0.1.5"}&lt;/p&gt;

&lt;p&gt;run &lt;em&gt;mix deps.get&lt;/em&gt; at project root folder&lt;/p&gt;

&lt;h2&gt;
  
  
  check installation
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;iex&amp;gt; Exyt.check_setup()
"Installed yt-dlp version: 2023.07.06\n"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  usage
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#sync
options = ["extract-audio", "audio-format": "mp3"]
iex&amp;gt; Exyt.download("https://www.youtube.com/watch?v=bWXazVhlyxQ", options)
{:ok, filename}

#async
options = ["extract-audio", "audio-format": "mp3"]
iex&amp;gt; Exyt.download("https://www.youtube.com/watch?v=bWXazVhlyxQ", options, :async)
{:ok, PID}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  docs for more details
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://hexdocs.pm/exyt_dlp/Exyt.html#content" rel="noopener noreferrer"&gt;https://hexdocs.pm/exyt_dlp/Exyt.html#content&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;accepting PRs :)&lt;/p&gt;

</description>
      <category>elixir</category>
      <category>youtube</category>
      <category>ytdlp</category>
      <category>exyt</category>
    </item>
  </channel>
</rss>
