qbittorrent / qBittorrent

qBittorrent BitTorrent client
https://www.qbittorrent.org
Other
26.84k stars 3.87k forks source link

Add setting to use RSS item title as torrent name #15

Open cdumez opened 12 years ago

cdumez commented 12 years ago

Some users would find it useful if qBittorrent could use the title of the RSS item as torrent / file name so that it would look something like:

Lost.S06E05.Lighthouse.DD51.720p.WEB-DL.AVC-FUSiON.mkv -> Lost [6x05] Lighthouse.mkv

Gelmir commented 11 years ago

@cdumez, I guess this can be done, but should we consider other possible namings?

Since nobody uses a unified naming convention, filename can be very different. E.g. release group can be perpended; season/episode letter can actually be a full word (season, episode); season/episode can be separated by special character; there might be no season at all (anime release groups don't tend to use 'em at all); name.episode can be separated with more than one symbol.

P.S. This also implements smart episode filter, requested somewhere on forums.

Gelmir commented 11 years ago

I'll bump this, since it tagged for 3.1.

sledgehammer999 commented 11 years ago

Idea for detecting season/episode number: Search for this kind of patern "S-number-E-number"

  1. Most of those releases separate each value either by using a .(dot) or _(underscore).
  2. The show name, season/episode number, episode name are usually at the beginning of the string
  3. Many groups'(anime fansubs usually) names are in [] at the beginning of the string.
Gelmir commented 11 years ago

@sledgehammer999, how about revamping addTorrent addMagnet methods and removing TorrentTempData.

Currently we have:

QTorrentHandle addTorrent(QString path, bool fromScanDir = false, QString from_url = QString(), bool resumed = false);
QTorrentHandle addMagnetUri(QString magnet_uri, bool resumed=false, bool fromScanDir=false, const QString &filePath=QString());
void addMagnetSkipAddDlg(const QString& uri, const QString& save_path = QString(), const QString& label = QString());
void addMagnetInteractive(const QString& uri);
void downloadFromURLList(const QStringList& urls);
void downloadUrlAndSkipDialog(QString url, QString save_path=QString(), QString label=QString(), const QList<QNetworkCookie>& cookies = QList<QNetworkCookie>());

I suggest adding a qadd_torrent_params class to fill the data for torrent addition. This will remove unnecessary overloads and will allow to override default options easily (e.g. this issue and ignoring 'add torrents paused' in RSS may be handy too)

sledgehammer999 commented 10 years ago

I am not interested in this feature being implemented ATM. However, if @Gelmir has code for extracting the name from the RSS title I'll be happy to merge it, even it doesn't cover all use cases.

@sledgehammer999, how about revamping addTorrent addMagnet methods and removing TorrentTempData.

Currently I was thinking the same thing. How to eradicate all this functions down to 1 or 2. This discussion however belongs elsewhere.

PS: I pushed code in master which uses add_torrent() for magnets too, so the 2 functions can probably be merged together now.