Giter VIP home page Giter VIP logo

cross-seed-autodl's People

Contributors

bc44 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cross-seed-autodl's Issues

Add a delay parameter

Add a delay parameter so we dont get banned after making 500 search requests one instantly right after the other

-d, --delay <delay> Pause duration (seconds) between searches (default: 10)

Script dies same point every time

Error:

Searching for 100 of 1870: The Increasingly Poor Decisions of Todd Margaret 
Traceback (most recent call last):
  File "/mnt/user/data/scripts/cross-seed/CrossSeedAutoDL.py", line 375, in <module>
    main()
  File "/mnt/user/data/scripts/cross-seed/CrossSeedAutoDL.py", line 347, in main
    matching_results = searcher.search(local_release_data, search_history)
  File "/mnt/user/data/scripts/cross-seed/CrossSeedAutoDL.py", line 137, in search
    self.search_results = self._trim_results( resp_json['Results'] )
  File "/mnt/user/data/scripts/cross-seed/CrossSeedAutoDL.py", line 188, in _trim_results
    new_result['Title'] = self._reformat_release_name( new_result['Title'] )
  File "/mnt/user/data/scripts/cross-seed/CrossSeedAutoDL.py", line 197, in _reformat_release_name
    return re.search(release_name_re, release_name, re.IGNORECASE).group(1)
AttributeError: 'NoneType' object has no attribute 'group'

Every time I run this script for my series it keeps dying at this point.

Thoughts?

russian characters in file name are <undefined>

one of my folders has "Михалёв" in its name. trying to search for a match does not work and i get this error.

--- Logging error ---
Traceback (most recent call last):
  File "C:\Python\Python391\lib\logging\__init__.py", line 1082, in emit
    stream.write(msg + self.terminator)
  File "C:\Python\Python391\lib\encodings\cp1252.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode characters in position 155-161: character maps to <undefined>
Call stack:
  File "Cross-Seeding-NFO\CrossSeedAutoDL.py", line 399, in <module>
    main()
  File "Cross-Seeding-NFO\CrossSeedAutoDL.py", line 367, in main
    logger.info(info + f'/ {os.path.basename(path)}')
Message: 'Searching for *********************'
Arguments: ()
0 matched of 0 results.

The script didnt crash but rather kept going which is real nice but i thought i should bring it to your attention anyways.
maybe add support for such characters or maybe skip them in the search idk

thanks for the great script!

Long paths causing crash

Hi, whenever the tool attempts to search a longer than normal path l I get a crash. I'm using shared network folders, if it matters. Ideally it shouldn't end the process but instead could just skip it.
Example:

Traceback (most recent call last):
  File "CrossSeedAutoDL.py", line 235, in <module>
    main()
  File "CrossSeedAutoDL.py", line 73, in main
    pathSize = get_size(path)
  File "CrossSeedAutoDL.py", line 130, in get_size
    filesize = get_file_size(os.path.join(root, filename))
  File "CrossSeedAutoDL.py", line 139, in get_file_size
    targetPath = os.readlink(filepath)
FileNotFoundError: [WinError 3] The system cannot find the path specified: "\\\\nas\\TV-Shows\\Its Always Sunny in Philadelphia\\Its.Always.Sunny.In.Philadelphia.S09.720p.WEB-DL.AAC2.0.H.264-BS\\It's.Always.Sunny.In.Philadelphia.S09.720p.WEB-DL.AAC2.0.H.264-BS\\It's.Always.Sunny.In.Philadelphia.S09E01.The.Gang.Broke.Dee.720p.WEB-DL.AAC2.0.H.264-BS.mkv"

Matching incorrect release groups

i'm running into an issue where i'm getting matched the incorrect group for my torrents, and this seems to happen a lot.
heres a snippet of the latest log:

Module: CrossSeedAutoDL - Line: 367 - Message: Searching for: Honey I Shrunk the Kids 1989/ Honey.I.Shrunk.the.Kids.1989.BluRay.1080p.DTS-HD.MA.5.1.AVC.REMUX-FraMeSToR

Module: CrossSeedAutoDL - Line: 113 - Message: http://...

Module: CrossSeedAutoDL - Line: 192 - Message: 4 matched of 13 results.

Module: CrossSeedAutoDL - Line: 269 - Message: - Grabbing release: Honey I Shrunk the Kids 1989 BluRay 1080p DTS-HD MA 5.1 AVC REMUX-FraMeSToR [***]

Module: CrossSeedAutoDL - Line: 269 - Message: - Grabbing release: Honey I Shrunk the Kids 1989 BluRay 1080p DTS-HD MA 5.1 AVC REMUX-FraMeSToR [***]

Module: CrossSeedAutoDL - Line: 269 - Message: - Grabbing release: Honey I Shrunk the Kids 1989 1080p BluRay REMUX AVC DTS-HD MA 5.1-EPSiLON [***]

Module: CrossSeedAutoDL - Line: 269 - Message: - Grabbing release: Honey I Shrunk the Kids 1989 1080p Blu-ray Remux AVC DTS-HD MA 5.1 - KRaLiMaRKo [***]

sometimes i get pmp, decibel, privatehd, legi0n, etc.

It would seems pretty obvious to me that a framestor release is not the same as a epsilon or kralimarko release so i was wondering why i'm getting these incorrect matches?

maybe release group isn't weighted heavily enough in the search terms?

linux version

hi,

im curious if you could make this work, for ubuntu / linux,
i would love to have this running directly on my seedbox!!!!!!
keep up the great work!

Have some difficulty to match movie from SC

Hi,

I notice than it match none movie from SC.
SC have a strange naming structure on Jackett.

  • Regular name:
<Director Name> - <Movie Name> [<Year>] <Quality Profile>

i.e. Dario Argento -​ Phenomena [1985] 720p Keiichi Tanaami & Nobuhiro Aihara - 2011 - Dreams

  • Full name:
<Director Name> - <Movie Name> [<Year>] <Quality Profile> / <Year edition> <Cut Version>

i.e. Dario Argento -​ Phenomena [1985] 1080p /​ 2018 Italian Cut

README feedback - hard to understand for the layman

README page of this repository says

  1. "Parses existing files/folders in order to download matching torrents"
    But the word "matching" is raising numerous questions of the first time visitor and a layman bittorrent client user:
    To which extent matching? Will it match the torrent if only one of the payload files is found?
    Will it match torrent if all files are found, but one or more is renamed?
    Does it search parse directory recursively infinite deep?

  2. "Copy exact string for the tracker that appears in the torznab feed URL in Jackett to use for the script"
    That is too technical description. Does the sentence and the screenshot mean that the user needs to copy "blutopia" and this string need to be somehow (how) used in the script (not mentioned the script name, is meant CrossSeedAutoDL.py?)

If I am right maybe the README should say:
Copy exact string for the tracker that appears in the torznab feed URL in Jackett (on the screenshot "blutopia") to use for the script CrossSeedAutoDL.py (CrossSeedAutoDL.py -parametername blutopia) to achieve XY.

Can you make the README more useful in this regard?

Search keeps randomly stopping

I keep having an issue trying to run this. This last run I got to 179 out of 1349. It just stops with the following error:

Searching for 179 of 1349:      ['Jr Jr Good Old Days 2020']    ['Jr Jr - Good Old Days (2020) [WEB FLAC]', 23962301]

Traceback (most recent call last):
  File "CrossSeedAutoDL.py", line 235, in <module>
    main()
  File "CrossSeedAutoDL.py", line 99, in main
    returnedJSON = json.loads(source)
  File "/usr/lib/python3.7/json/__init__.py", line 348, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.7/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.7/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Any ideas what the cause could be? I'm running this on a seedbox Debian 10 and Python v3.7.3 Thanks!

FR: Add Support For Prowlarr

Title.

Add Support for Prowlarr

edit: additional context

would likely need to use the /search endpoint and then also the indexers endpoint as well

OSError: [Errno 36] File name too long

I have change the categories so jackett can search ebooks.
Working fine.
Today i saw this error.

Searching for 716 of 9787: Shrubs
5 matched of 43 results.

  • Grabbing release: Shrubs An Old-Fashioned Drink for Modern Times (2nd Edition) by Michael Dietsch [2016] [EPUB] [Retail] [B]
  • Grabbing release: 50 Beautiful Deer-Resistant Plants The Prettiest Annuals Perennials Bulbs and Shrubs That Deer Dont Eat by Ruth Rogers Clausen [2011] [PDF] [Retail] [B]
  • Grabbing release: Mocktails Punches and Shrubs Over 80 Nonalcoholic Drinks to Savor and Enjoy by Vikas Khanna [2017] [PDF] [Retail] [B]
  • Grabbing release: The Art of Creative Pruning Inventive Ideas for Training and Shaping Trees and Shrubs by Jake Hobson [2012] [EPUB] [Retail] [B]
  • Grabbing release: Homemade Soda 200 Recipes for Making Using Fruit Sodas Fizzy Juices Sparkling Waters Root Beers Cola Brews Herbal Healing Waters Sparkling Teas Coffees Shrubs Switchels Cream Sodas Floats Other Carbonated Concoctions by Andrew Schloss [2011] [PDF] [Retail] [B]
    Traceback (most recent call last):
    File "CrossSeedAutoDL.py", line 399, in
    main()
    File "CrossSeedAutoDL.py", line 374, in main
    Downloader.download(result, search_history)
    File "CrossSeedAutoDL.py", line 272, in download
    with open(file_path, 'wb') as f:
    OSError: [Errno 36] File name too long: '/mnt/downloads2/incomplete/rutorrent/2/Homemade Soda 200 Recipes for Making Using Fruit Sodas Fizzy Juices Sparkling Waters Root Beers Cola Brews Herbal Healing Waters Sparkling Teas Coffees Shrubs Switchels Cream Sodas Floats Other Carbonated Concoctions by Andrew Schloss [2011] [PDF] [Retail] [B].torrent'

Searches for but cannot match/download the .torrent

I get: https://imgkk.com/i/-pw-.png this while i run the script, so it searches for, but never prints anything about success or that it has begun the download.

This is what is in the logs,

2022-06-10 12:42:52,433 - Module: CrossSeedAutoDL - Line: 396 - Message: Searching for 3 of 233: Citizen Kane 1941/ Citizen.Kane.1941.1080p.BluRay.FLAC1.0.x264-ZQ.mkv.torrent

2022-06-10 12:42:52,433 - Module: CrossSeedAutoDL - Line: 116 - Message: http://192.168.0.191:9117/jackett/api/v2.0/indexers/all/results?apikey=JACKETTAPI&Query=Citizen+Kane+1941&Tracker%5B%5D=beyond-hd-api&Category%5B%5D=2000

No matter how I fiddle with the parameters I just cant get it to work, I confirmed a cross-seedable torrent, pointed it straight at the MKV and it still didn't pick it up.

Not sure where to go!

Scripts hangs if a tracker goes down for a short time

Well it seems too have moved past the spot. However, new issue.

Traceback (most recent call last):
File "/mnt/user/data/scripts/cross-seed/CrossSeedAutoDL.py", line 384, in
main()
File "/mnt/user/data/scripts/cross-seed/CrossSeedAutoDL.py", line 355, in main
matching_results = searcher.search(local_release_data, search_history)
File "/mnt/user/data/scripts/cross-seed/CrossSeedAutoDL.py", line 115, in search
resp = requests.get(search_url, local_release_data)
File "/usr/lib64/python3.9/site-packages/requests/api.py", line 76, in get
return request('get', url, params=params, **kwargs)
File "/usr/lib64/python3.9/site-packages/requests/api.py", line 61, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/lib64/python3.9/site-packages/requests/sessions.py", line 542, in request
resp = self.send(prep, **send_kwargs)
File "/usr/lib64/python3.9/site-packages/requests/sessions.py", line 655, in send
r = adapter.send(request, **kwargs)
File "/usr/lib64/python3.9/site-packages/requests/adapters.py", line 516, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='192.168.1.200', port=9117): Max retries exceeded with url: /api/v2.0/indexers/all/results?apikey=<api>&Query=My+Little+Pony&Tracker%5B%5D=beyond-hd-oneurl%2Canimebytes%2Cbroadcasthenet&Category%5B%5D=5000&season=2&main_path=%2Fmnt%2Fuser%2Fdata%2F.torrents%2Fseries%2FMy+Little+Pony+-+Friendship+Is+Magic+S02+1080p+Netflix+WEB-DL+DD%2B+5.1+x264-TrollHD&basename=My+Little+Pony+-+Friendship+Is+Magic+S02+1080p+Netflix+WEB-DL+DD%2B+5.1+x264-TrollHD&size=19062244781&guessed_data=title&guessed_data=alternative_title&guessed_data=season&guessed_data=screen_size&guessed_data=streaming_service&guessed_data=source&guessed_data=audio_codec&guessed_data=audio_channels&guessed_data=video_codec&guessed_data=release_group&guessed_data=type (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused'))

Seems like it occurs when one of the trackers goes down for a moment or two on Jackett. What makes this a bigger issue is that I have over 5,000 torrents in my. folder and the odds of a tracker going down or having some sort of hiccup between it and Jackett goes up considering the amount of time it takes to go through all 5,000+ (especially the first time or with history ignored).

I guess I can roll a feature request in to this. Is there a way to have a config file that we can input the Torznab link into it (along with Jackett API and IP address) so that we aren't using the /all end point? Just an idea.

[Suggestion] Adding the tracker name at the torrent file name

It would be nice to add the tracker name at the torrent file name.
Something like [TrackerName] Filename.torrent

In case of multi result, the result would be much better:

- [Tracker A] My.Wonderful.Movie.torrent
- [Tracker B] My.Wonderful.Movie.torrent
- [Tracker C] My.Wonderful.Movie.torrent

Intead of:

- My.Wonderful.Movie.torrent
- My.Wonderful.Movie (1).torrent
- My.Wonderful.Movie (2).torrent

The name of the torrent is use as the base by autotorrent to create the directory for links.
I did some test with my fork, it's work very well with autotorrent. Much easiest to manage and far cleaner.

I can propose a PR if you are interested.

Invalid syntax

Running Ubuntu 18 I get this after configuration

File "CrossSeedBDs.py", line 77 editedTitle = re.sub(AKA_DUAL_LANG_NAME_RE, r'\1', title, flags=re.IGNORECASE) + f' {year} {group}' ^ SyntaxError: invalid syntax

SyntaxError: invalid syntax

adamwinn@DiskStation:~/scripts/Cross-Seed-AutoDL/Cross-Seed-AutoDL$ python3 --version
Python 3.5.1
adamwinn@DiskStation:~/scripts/Cross-Seed-AutoDL/Cross-Seed-AutoDL$ python3 CrossSeedAutoDL.py
  File "CrossSeedAutoDL.py", line 77
    editedTitle = re.sub(AKA_DUAL_LANG_NAME_RE, r'\1', title, flags=re.IGNORECASE) + f' {year}'
                                                                                              ^
SyntaxError: invalid syntax

`SearchHistory.json` is not created if missing

I have this traceback with the --ignore-history used :

Traceback (most recent call last):
  File "/app/cross-seed/CrossSeedAutoDL.py", line 429, in <module>
    main()
  File "/app/cross-seed/CrossSeedAutoDL.py", line 357, in main
    history_json_fd = open(HistoryManager.search_history_file_path, 'r+', encoding='utf8')
FileNotFoundError: [Errno 2] No such file or directory: '/app/cross-seed/SearchHistory.json'

Is it really necessary to try to read (or check) the history file in this case ?

If magnet is not supported, please allow us to skip it and continue on instead of exiting

It would be nice if the script continued on so it doesn't die if it encounters a magnet link

3 matched of 17 results.
- Grabbing release: [PassThePopcorn] 1932_The Death Kiss
- Grabbing release: [ETTV] The Death Kiss (1932) DVD5 Untouched - Bela Lugosi [DDR]
Traceback (most recent call last):
  File "/volume1/homes/scripts/Cross-Seed-AutoDL-master/CrossSeedAutoDL.py", line 430, in <module>
    main()
  File "/volume1/homes/scripts/Cross-Seed-AutoDL-master/CrossSeedAutoDL.py", line 390, in main
    Downloader.download(result, search_history)
  File "/volume1/homes/scripts/Cross-Seed-AutoDL-master/CrossSeedAutoDL.py", line 257, in download
    response = requests.get(result['Link'], stream=True)
  File "/var/services/homes/.local/lib/python3.9/site-packages/requests/api.py", line 76, in get
    return request('get', url, params=params, **kwargs)
  File "/var/services/homes/.local/lib/python3.9/site-packages/requests/api.py", line 61, in request
    return session.request(method=method, url=url, **kwargs)
  File "/var/services/homes/.local/lib/python3.9/site-packages/requests/sessions.py", line 542, in request
    resp = self.send(prep, **send_kwargs)
  File "/var/services/homes/.local/lib/python3.9/site-packages/requests/sessions.py", line 677, in send
    history = [resp for resp in gen]
  File "/var/services/homes/.local/lib/python3.9/site-packages/requests/sessions.py", line 677, in <listcomp>
    history = [resp for resp in gen]
  File "/var/services/homes/.local/lib/python3.9/site-packages/requests/sessions.py", line 237, in resolve_redirects
    resp = self.send(
  File "/var/services/homes/.local/lib/python3.9/site-packages/requests/sessions.py", line 649, in send
    adapter = self.get_adapter(url=request.url)
  File "/var/services/homes/.local/lib/python3.9/site-packages/requests/sessions.py", line 742, in get_adapter
    raise InvalidSchema("No connection adapters were found for {!r}".format(url))
requests.exceptions.InvalidSchema: No connection adapters were found for 'magnet:?xt=urn:btih:223a06d7680ec8c544ef124a6a8050b98919d08f&dn=The+Death+Kiss+%281932%29+DVD5+Untouched+-+Bela+Lugosi+%5BDDR%5D&xl=0&tr=http%3A%2F%2Ftracker.aletorrenty.pl:2710/announce&tr=udp%3A%2F%2F178.33.73.26:2710/announce&tr=udp%3A%2F%2Ftracker.leechers-paradise.org:6969/announce&tr=udp%3A%2F%2Ftracker.mg64.net:6969/announce&tr=udp%3A%2F%2Ftracker.coppersurfer.tk:6969/announce&tr=udp%3A%2F%2Fopen.demonii.com:1337/announce&tr=udp%3A%2F%2Ftracker.internetwarriors.net:1337/announce&tr=udp%3A%2F%2F9.rarbg.me:2750/announce&tr=udp%3A%2F%2Ftracker.ex.ua:80/announce&tr=udp%3A%2F%2Fpow7.com:80/announce&tr=udp%3A%2F%2Fipv4.tracker.harry.lu:80/announce&tr=udp%3A%2F%2Ftracker.openbittorrent.com/announce&tr=udp%3A%2F%2Fexodus.desync.com:6969/announce&tr=udp%3A%2F%2F11.rarbg.com/announce'

Getting error when searching

Error:

Traceback (most recent call last):
  File "CrossSeedAutoDL.py", line 354, in <module>
    main()
  File "CrossSeedAutoDL.py", line 313, in main
    title=local_release_data['guessed_data']['title'],
KeyError: 'title'

Invalid URL 'None': No schema supplied.

Hi
When running this it starts downloading a few torrents successfully but then always fails at the same place:

Traceback (most recent call last):
  File "CrossSeedAutoDL.py", line 232, in <module>
    main()
  File "CrossSeedAutoDL.py", line 105, in main
    found, announceDownloadings = findMatchingTorrent(returnedJSON, pathSize, path)
  File "CrossSeedAutoDL.py", line 201, in findMatchingTorrent
    downloadTorrent(downloadURL, listingTitle)
  File "CrossSeedAutoDL.py", line 214, in downloadTorrent
    response = requests.get(downloadURL, stream=True)
  File "C:\Users\testuser\AppData\Local\Programs\Python\Python38-32\lib\site-packages\requests\api.py", line 76, in get
    return request('get', url, params=params, **kwargs)
  File "C:\Users\testuser\AppData\Local\Programs\Python\Python38-32\lib\site-packages\requests\api.py", line 61, in request
    return session.request(method=method, url=url, **kwargs)
  File "C:\Users\testuser\AppData\Local\Programs\Python\Python38-32\lib\site-packages\requests\sessions.py", line 516, in request
    prep = self.prepare_request(req)
  File "C:\Users\testuser\AppData\Local\Programs\Python\Python38-32\lib\site-packages\requests\sessions.py", line 449, in prepare_request
    p.prepare(
  File "C:\Users\testuser\AppData\Local\Programs\Python\Python38-32\lib\site-packages\requests\models.py", line 314, in prepare
    self.prepare_url(url, params)
  File "C:\Users\testuser\AppData\Local\Programs\Python\Python38-32\lib\site-packages\requests\models.py", line 388, in prepare_url
    raise MissingSchema(error)
requests.exceptions.MissingSchema: Invalid URL 'None': No schema supplied. Perhaps you meant http://None?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.