Package Details: ytmdl 2023.2.28-0

Git Clone URL: https://aur.archlinux.org/ytmdl.git (read-only, click to copy)
Package Base: ytmdl
Description: Download songs from YouTube with metadata from sources like Itunes, Gaana, Deezer etc.
Upstream URL: https://github.com/deepjyoti30/ytmdl
Keywords: cli ffmpeg freemusic gaana high-quality-ads itunes metadata music music-bot songs spotify youtube
Licenses: MIT
Conflicts: ytmdl
Provides: ytmdl
Submitter: deepjyoti30
Maintainer: deepjyoti30
Last Packager: deepjyoti30
Votes: 13
Popularity: 0.000054
First Submitted: 2019-11-09 07:25 (UTC)
Last Updated: 2023-05-20 06:17 (UTC)

Latest Comments

1 2 3 4 Next › Last »

xiota commented on 2023-06-18 22:35 (UTC)

@MarsSeed See previous comments. Maintainer is highly resistant to making any changes to this package.

For anyone interested, here is an updated PKGBUILD:

_pkgname="ytmdl"
pkgname="$_pkgname"
pkgver=2023.2.28
pkgrel=1
pkgdesc="Download songs from YouTube with metadata from sources like iTunes and Gaana"
arch=("any")
url="https://github.com/deepjyoti30/ytmdl"
license=('MIT')

depends=(
  'python-beautifulsoup4'
  'python-musicbrainzngs'
  'python-mutagen'
  'python-pyxdg'
  'python-rich'
  'python-unidecode'
  'python-urllib3'
  'python-ytmusicapi'
  'yt-dlp'

  # AUR
  'downloader-cli'
  'python-ffmpeg-python'
  'python-itunespy'
  'python-pydes'
  'python-simber'
  'python-spotipy'
  'youtube-search-python'
)
makedepends=(
  'python-build'
  'python-installer'
  'python-setuptools'
  'python-wheel'
)

provides=("$_pkgname")
conflicts=(${provides[@]})

source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha256sums=('SKIP')

prepare() {
  cd "$srcdir/$_pkgname-$pkgver"
  mv "ytmdl.zsh" "_ytmdl.zsh"
  mv "ytmdl.bash" "_ytmdl.bash"
}

build() {
  cd "$srcdir/$_pkgname-$pkgver"
  python -m build --no-isolation --wheel --skip-dependency-check
}

package() {
  cd "$srcdir/$_pkgname-$pkgver"
  python -m installer --destdir="$pkgdir" dist/*.whl

  install -Dm664 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname"

  install -Dm644 "_ytmdl.zsh" "$pkgdir/usr/share/zsh/site-functions/_ytmdl"
  install -Dm644 "_ytmdl.bash" "$pkgdir/usr/share/bash-completion/completions/ytmdl"
}

MarsSeed commented on 2023-06-18 19:55 (UTC) (edited on 2023-07-12 18:24 (UTC) by MarsSeed)

I've noticed another needed adjustment.

Summary of necessary changes:

MarsSeed commented on 2023-06-18 00:15 (UTC)

After recent package changes on AUR, please switch dependency python-ffmpeg to python-ffmpeg-python.

As per my checking, this project requires pypi/ffmpeg-python, and my suggestion above is the appropriate choice for that.

(There is a new AUR/python-python-ffmpeg package, but that is a new and incompatible project, built from pypi/python-ffmpeg.)

xiota commented on 2023-05-20 08:59 (UTC) (edited on 2023-05-20 09:00 (UTC) by xiota)

ytmdl uses these directory to ship the autocomplete files

The installer places them in the nonstandard directories initially. If left there, without any further action, autocompletion does not work.

Here is the package function:

package() {
    cd "${pkgname}-${pkgver}"
    python setup.py install --prefix=/usr --root="$pkgdir/" --optimize=1 --skip-build
    install -Dm644 "${pkgdir}/share/bash-completion/completions/ytmdl.bash" \
    "${pkgdir}/usr/share/bash-completion/completions/ytmdl"
    install -Dm644 "${pkgdir}/usr/share/zsh/functions/Completion/Unix/ytmdl.zsh" \
    "${pkgdir}/usr/share/zsh/site-functions/_ytmdl"
}

These lines copy the files to the standard locations, which allow autocompletion to work as expected.

    install -Dm644 "${pkgdir}/share/bash-completion/completions/ytmdl.bash" \
    "${pkgdir}/usr/share/bash-completion/completions/ytmdl"
    install -Dm644 "${pkgdir}/usr/share/zsh/functions/Completion/Unix/ytmdl.zsh" \
    "${pkgdir}/usr/share/zsh/site-functions/_ytmdl"

Since the initial locations are unused, and the relevant files are copied elsewhere, the originals can be removed from the package without affecting functionality.

rm -rf "${pkgdir}/share/"
rm "${pkgdir}/usr/share/zsh/functions/Completion/Unix/ytmdl.zsh"
find "$pkgdir/usr/share" -depth -mindepth 1 -type d -empty -exec rmdir -v "{}" \;

xiota commented on 2023-05-20 08:52 (UTC)

ytmdl needs at-least that version for it to work, removing the version strings might break ytmdl

The existing versions of those packages are already higher than the requested strings. Arch is highly unlikely to downgrade those packages. So the version strings are superfluous at best, and in some cases, block the use of legitimate alternates, like -git packages.

xiota commented on 2023-05-20 08:47 (UTC)

Will look into this and see if possible to migrate to it.

It is possible. I have already made a PKGBUILD implementing the change.

xiota commented on 2023-05-20 08:44 (UTC) (edited on 2023-05-20 08:46 (UTC) by xiota)

LICENSE file was already being included in the package

Here is the package function in its entirety. There is no command to install the LICENSE file. If the LICENSE file is installed, it is located at a nonstandard location.

package() {
    cd "${pkgname}-${pkgver}"
    python setup.py install --prefix=/usr --root="$pkgdir/" --optimize=1 --skip-build
    install -Dm644 "${pkgdir}/share/bash-completion/completions/ytmdl.bash" \
    "${pkgdir}/usr/share/bash-completion/completions/ytmdl"
    install -Dm644 "${pkgdir}/usr/share/zsh/functions/Completion/Unix/ytmdl.zsh" \
    "${pkgdir}/usr/share/zsh/site-functions/_ytmdl"
}

Adding the following command will copy the file to the correct location.

  install -Dm664 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname"

deepjyoti30 commented on 2023-05-20 06:16 (UTC)

@xiota Thanks for the suggestions. I have taken some of them into consideration and will push the changes soon, however I am afraid other's cannot be done as of now:

  • Remove the non-standard /share directory. It is unnecessary because package() copies the files to standard locations. -> ytmdl uses these directory to ship the autocomplete files
  • Remove version strings from depends. They are unnecessary and block usage of -git packages. -> Only two dependencies have version strings and the reason is simple enough for that, ytmdl needs at-least that version for it to work, removing the version strings might break ytmdl.
  • Change ytmdl-git to ytmdl in conflicts (or remove it). Conflicting with ytmdl-git is unnecessary because it already conflicts/provides ytmdl. -> Makes sense, will make the change.
  • Add the LICENSE file to the package. -> LICENSE file was already being included in the package
  • Use PEP517 method to install. -> Will look into this and see if possible to migrate to it.

xiota commented on 2023-05-17 02:33 (UTC) (edited on 2023-05-17 05:28 (UTC) by xiota)

Please make the following changes:

  • Remove the non-standard /share directory. It is unnecessary because package() copies the files to standard locations.

  • Remove version strings from depends. They are unnecessary and block usage of -git packages.

  • Change ytmdl-git to ytmdl in conflicts (or remove it). Conflicting with ytmdl-git is unnecessary because it already conflicts/provides ytmdl.

  • Add the LICENSE file to the package.

  • Use PEP517 method to install.