Skip to content

Instantly share code, notes, and snippets.

@namandixit
Last active September 13, 2024 09:12
Show Gist options
  • Save namandixit/d18a8faae44376d1dcd33c7cdff42634 to your computer and use it in GitHub Desktop.
Save namandixit/d18a8faae44376d1dcd33c7cdff42634 to your computer and use it in GitHub Desktop.
QBittorent backup all torrent files
#!/usr/bin/env python3
import libtorrent as lt
import sys
import os
# Location of torrent files: https://github.com/qbittorrent/qBittorrent/wiki/Frequently-Asked-Questions#Where_does_qBittorrent_save_its_settings
os.chdir('BT_backup')
dirname = '.'
ext = ('.torrent')
for tf in os.listdir(dirname):
if tf.endswith(ext):
ti = lt.torrent_info(tf)
print(tf, " =>> ", ti.name())
# os.rename(tf, ti.name()+".torrent")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment