From 9a40095c42f16b74e984782d8ac9cb9505cac559 Mon Sep 17 00:00:00 2001 From: CoprDistGit Date: Mon, 10 Apr 2023 15:03:51 +0000 Subject: automatic import of python-parse-torrent-name --- python-parse-torrent-name.spec | 564 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 564 insertions(+) create mode 100644 python-parse-torrent-name.spec (limited to 'python-parse-torrent-name.spec') diff --git a/python-parse-torrent-name.spec b/python-parse-torrent-name.spec new file mode 100644 index 0000000..e75b6c8 --- /dev/null +++ b/python-parse-torrent-name.spec @@ -0,0 +1,564 @@ +%global _empty_manifest_terminate_build 0 +Name: python-parse-torrent-name +Version: 1.1.1 +Release: 1 +Summary: Extract media information from torrent-like filename +License: MIT +URL: https://github.com/divijbindlish/parse-torrent-name +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/1a/c9/fbafe4f215ff24a1209e848763699cb8831d459c138fe164ea45b04c02ea/parse-torrent-name-1.1.1.tar.gz +BuildArch: noarch + + +%description +# parse-torrent-name ![Build status](https://travis-ci.org/divijbindlish/parse-torrent-name.svg?branch=master) + +> Extract media information from torrent-like filename + +![Python versions](https://img.shields.io/badge/Python-2.7%2C%203.3-brightgreen.svg?style=flat-square) + +A python port of [Jānis](https://github.com/jzjzjzj)' awesome +[library](http s://github.com/jzjzjzj/parse-torrent-name) written in +javascript. + +Extract all possible media information present in filenames. Multiple regex +rules are applied on filename string each of which extracts correponding +information from the filename. If a regex rule matches, the corresponding part +is removed from the filename. In the end, the remaining part is taken as the +title of the content. + +## Why? + +Online APIs by providers like +[TMDb](https://www.themoviedb.org/documentation/api), +[TVDb](http://thetvdb.com/wiki/index.php?title=Programmers_API) and +[OMDb](http://www.omdbapi.com/) don't react to well to search +queries which include any kind of extra information. To get proper results from +these APIs, only the title of the content should be provided as the search +query where this library comes into play. The accuracy of the results can be +improved by passing in the year which can also be extracted using this library. + +## Usage + +```py +import PTN + +info = PTN.parse('A freakishly cool movie or TV episode') + +print info # All details that were parsed +``` + +PTN works well for both movies and TV episodes. All meaningful information is +extracted and returned together in a dictionary. The text which could not be +parsed is returned in the `excess` field. + +### Movies + +```py +PTN.parse('San Andreas 2015 720p WEB-DL x264 AAC-JYK') +# { +# 'group': 'JYK', +# 'title': 'San Andreas', +# 'resolution': '720p', +# 'codec': 'x264', +# 'year': '2015', +# 'audio': 'AAC', +# 'quality': 'WEB-DL' +# } + +PTN.parse('The Martian 2015 540p HDRip KORSUB x264 AAC2 0-FGT') +# { +# 'group': '0-FGT', +# 'title': 'The Martian', +# 'resolution': '540p', +# 'excess': ['KORSUB', '2'], +# 'codec': 'x264', +# 'year': 2015, +# 'audio': 'AAC', +# 'quality': 'HDRip' +# } +``` + +### TV episodes + +```py +PTN.parse('Mr Robot S01E05 HDTV x264-KILLERS[ettv]') +# { +# 'episode': 5, +# 'season': 1, +# 'title': 'Mr Robot', +# 'codec': 'x264', +# 'group': 'KILLERS[ettv]' +# 'quality': 'HDTV' +# } + +PTN.parse('friends.s02e01.720p.bluray-sujaidr') +# { +# 'episode': 1, +# 'season': 2, +# 'title': 'friends', +# 'resolution': '720p', +# 'group': 'sujaidr', +# 'quality': 'bluray' +# } +``` + +### Note + +PTN does not gaurantee the fields `group`, `excess` and `episodeName` as these +fields might be interchanged with each other. This shoudn't affect most +applications since episode name can be fetched from an online database +after getting the season and episode number correctly. + +### Parts extracted + +* audio +* codec +* container +* episode +* episodeName +* excess +* extended +* garbage +* group +* hardcoded +* language +* proper +* quality +* region +* repack +* resolution +* season +* title +* website +* widescreen +* year + +## Install + +### Automatic + +PTN can be installed automatically using `easy_install` or `pip`. + +```sh +$ easy_install parse-torrent-name +``` + +OR + +```sh +$ pip install parse-torrent-name +``` + +Note that these commands might require `sudo` permission depending on whether +a virtual environment is used or not. + +### Manual + +First clone the repository. + +```sh +$ git clone https://github.com/divijbindlish/parse-torrent-name PTN && cd PTN +``` + +And run the command for installing the package. + +```sh +$ python setup.py install +``` + +## Contributing + +Take a look at the open +[issues](https://github.com/jzjzjzj/parse-torrent-name/issues) on the original +project and submit a PR! + +## License + +MIT © [Divij Bindlish](http://divijbindlish.in) + +%package -n python3-parse-torrent-name +Summary: Extract media information from torrent-like filename +Provides: python-parse-torrent-name +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-parse-torrent-name +# parse-torrent-name ![Build status](https://travis-ci.org/divijbindlish/parse-torrent-name.svg?branch=master) + +> Extract media information from torrent-like filename + +![Python versions](https://img.shields.io/badge/Python-2.7%2C%203.3-brightgreen.svg?style=flat-square) + +A python port of [Jānis](https://github.com/jzjzjzj)' awesome +[library](http s://github.com/jzjzjzj/parse-torrent-name) written in +javascript. + +Extract all possible media information present in filenames. Multiple regex +rules are applied on filename string each of which extracts correponding +information from the filename. If a regex rule matches, the corresponding part +is removed from the filename. In the end, the remaining part is taken as the +title of the content. + +## Why? + +Online APIs by providers like +[TMDb](https://www.themoviedb.org/documentation/api), +[TVDb](http://thetvdb.com/wiki/index.php?title=Programmers_API) and +[OMDb](http://www.omdbapi.com/) don't react to well to search +queries which include any kind of extra information. To get proper results from +these APIs, only the title of the content should be provided as the search +query where this library comes into play. The accuracy of the results can be +improved by passing in the year which can also be extracted using this library. + +## Usage + +```py +import PTN + +info = PTN.parse('A freakishly cool movie or TV episode') + +print info # All details that were parsed +``` + +PTN works well for both movies and TV episodes. All meaningful information is +extracted and returned together in a dictionary. The text which could not be +parsed is returned in the `excess` field. + +### Movies + +```py +PTN.parse('San Andreas 2015 720p WEB-DL x264 AAC-JYK') +# { +# 'group': 'JYK', +# 'title': 'San Andreas', +# 'resolution': '720p', +# 'codec': 'x264', +# 'year': '2015', +# 'audio': 'AAC', +# 'quality': 'WEB-DL' +# } + +PTN.parse('The Martian 2015 540p HDRip KORSUB x264 AAC2 0-FGT') +# { +# 'group': '0-FGT', +# 'title': 'The Martian', +# 'resolution': '540p', +# 'excess': ['KORSUB', '2'], +# 'codec': 'x264', +# 'year': 2015, +# 'audio': 'AAC', +# 'quality': 'HDRip' +# } +``` + +### TV episodes + +```py +PTN.parse('Mr Robot S01E05 HDTV x264-KILLERS[ettv]') +# { +# 'episode': 5, +# 'season': 1, +# 'title': 'Mr Robot', +# 'codec': 'x264', +# 'group': 'KILLERS[ettv]' +# 'quality': 'HDTV' +# } + +PTN.parse('friends.s02e01.720p.bluray-sujaidr') +# { +# 'episode': 1, +# 'season': 2, +# 'title': 'friends', +# 'resolution': '720p', +# 'group': 'sujaidr', +# 'quality': 'bluray' +# } +``` + +### Note + +PTN does not gaurantee the fields `group`, `excess` and `episodeName` as these +fields might be interchanged with each other. This shoudn't affect most +applications since episode name can be fetched from an online database +after getting the season and episode number correctly. + +### Parts extracted + +* audio +* codec +* container +* episode +* episodeName +* excess +* extended +* garbage +* group +* hardcoded +* language +* proper +* quality +* region +* repack +* resolution +* season +* title +* website +* widescreen +* year + +## Install + +### Automatic + +PTN can be installed automatically using `easy_install` or `pip`. + +```sh +$ easy_install parse-torrent-name +``` + +OR + +```sh +$ pip install parse-torrent-name +``` + +Note that these commands might require `sudo` permission depending on whether +a virtual environment is used or not. + +### Manual + +First clone the repository. + +```sh +$ git clone https://github.com/divijbindlish/parse-torrent-name PTN && cd PTN +``` + +And run the command for installing the package. + +```sh +$ python setup.py install +``` + +## Contributing + +Take a look at the open +[issues](https://github.com/jzjzjzj/parse-torrent-name/issues) on the original +project and submit a PR! + +## License + +MIT © [Divij Bindlish](http://divijbindlish.in) + +%package help +Summary: Development documents and examples for parse-torrent-name +Provides: python3-parse-torrent-name-doc +%description help +# parse-torrent-name ![Build status](https://travis-ci.org/divijbindlish/parse-torrent-name.svg?branch=master) + +> Extract media information from torrent-like filename + +![Python versions](https://img.shields.io/badge/Python-2.7%2C%203.3-brightgreen.svg?style=flat-square) + +A python port of [Jānis](https://github.com/jzjzjzj)' awesome +[library](http s://github.com/jzjzjzj/parse-torrent-name) written in +javascript. + +Extract all possible media information present in filenames. Multiple regex +rules are applied on filename string each of which extracts correponding +information from the filename. If a regex rule matches, the corresponding part +is removed from the filename. In the end, the remaining part is taken as the +title of the content. + +## Why? + +Online APIs by providers like +[TMDb](https://www.themoviedb.org/documentation/api), +[TVDb](http://thetvdb.com/wiki/index.php?title=Programmers_API) and +[OMDb](http://www.omdbapi.com/) don't react to well to search +queries which include any kind of extra information. To get proper results from +these APIs, only the title of the content should be provided as the search +query where this library comes into play. The accuracy of the results can be +improved by passing in the year which can also be extracted using this library. + +## Usage + +```py +import PTN + +info = PTN.parse('A freakishly cool movie or TV episode') + +print info # All details that were parsed +``` + +PTN works well for both movies and TV episodes. All meaningful information is +extracted and returned together in a dictionary. The text which could not be +parsed is returned in the `excess` field. + +### Movies + +```py +PTN.parse('San Andreas 2015 720p WEB-DL x264 AAC-JYK') +# { +# 'group': 'JYK', +# 'title': 'San Andreas', +# 'resolution': '720p', +# 'codec': 'x264', +# 'year': '2015', +# 'audio': 'AAC', +# 'quality': 'WEB-DL' +# } + +PTN.parse('The Martian 2015 540p HDRip KORSUB x264 AAC2 0-FGT') +# { +# 'group': '0-FGT', +# 'title': 'The Martian', +# 'resolution': '540p', +# 'excess': ['KORSUB', '2'], +# 'codec': 'x264', +# 'year': 2015, +# 'audio': 'AAC', +# 'quality': 'HDRip' +# } +``` + +### TV episodes + +```py +PTN.parse('Mr Robot S01E05 HDTV x264-KILLERS[ettv]') +# { +# 'episode': 5, +# 'season': 1, +# 'title': 'Mr Robot', +# 'codec': 'x264', +# 'group': 'KILLERS[ettv]' +# 'quality': 'HDTV' +# } + +PTN.parse('friends.s02e01.720p.bluray-sujaidr') +# { +# 'episode': 1, +# 'season': 2, +# 'title': 'friends', +# 'resolution': '720p', +# 'group': 'sujaidr', +# 'quality': 'bluray' +# } +``` + +### Note + +PTN does not gaurantee the fields `group`, `excess` and `episodeName` as these +fields might be interchanged with each other. This shoudn't affect most +applications since episode name can be fetched from an online database +after getting the season and episode number correctly. + +### Parts extracted + +* audio +* codec +* container +* episode +* episodeName +* excess +* extended +* garbage +* group +* hardcoded +* language +* proper +* quality +* region +* repack +* resolution +* season +* title +* website +* widescreen +* year + +## Install + +### Automatic + +PTN can be installed automatically using `easy_install` or `pip`. + +```sh +$ easy_install parse-torrent-name +``` + +OR + +```sh +$ pip install parse-torrent-name +``` + +Note that these commands might require `sudo` permission depending on whether +a virtual environment is used or not. + +### Manual + +First clone the repository. + +```sh +$ git clone https://github.com/divijbindlish/parse-torrent-name PTN && cd PTN +``` + +And run the command for installing the package. + +```sh +$ python setup.py install +``` + +## Contributing + +Take a look at the open +[issues](https://github.com/jzjzjzj/parse-torrent-name/issues) on the original +project and submit a PR! + +## License + +MIT © [Divij Bindlish](http://divijbindlish.in) + +%prep +%autosetup -n parse-torrent-name-1.1.1 + +%build +%py3_build + +%install +%py3_install +install -d -m755 %{buildroot}/%{_pkgdocdir} +if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi +if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi +if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi +if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi +pushd %{buildroot} +if [ -d usr/lib ]; then + find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/lib64 ]; then + find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/bin ]; then + find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/sbin ]; then + find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst +fi +touch doclist.lst +if [ -d usr/share/man ]; then + find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst +fi +popd +mv %{buildroot}/filelist.lst . +mv %{buildroot}/doclist.lst . + +%files -n python3-parse-torrent-name -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Mon Apr 10 2023 Python_Bot - 1.1.1-1 +- Package Spec generated -- cgit v1.2.3