rivenmedia / riven

Handle your Media Library with ease!
https://rivenmedia.github.io/wiki/
GNU General Public License v3.0
396 stars 54 forks source link

[Bug Report] Error in the logs after hash blacklist implementation #591

Closed ramphex closed 3 months ago

ramphex commented 3 months ago

Since the implementation of the hash blacklist (ignore.txt), there is a persistent, repeating error in the logs

24-08-01 13:42:25 | πŸ€·β€ NOT_FOUND | torrentio.scrape - No streams found for Inside Out 2
24-08-01 13:42:25 | πŸ€·β€ NOT_FOUND | knightcrawler.scrape - No streams found for Inside Out 2
24-08-01 13:42:25 | πŸ‘» SCRAPER   | shared._parse_results - Processing 16 results for Inside Out 2
24-08-01 13:42:25 | πŸ‘» SCRAPER   | shared._parse_results - Processed 2 matches for Inside Out 2
24-08-01 13:42:25 | πŸ€– DEBUG     | shared._parse_results - Marking Torrent 9e61a4bb028a12bc00cc3b0a41638776c3c272a6 as blacklisted for item Inside Out 2
24-08-01 13:42:25 | ❌ ERROR     | program._process_future_item - Service Scraping failed with exception Traceback (most recent call last):
  File "/riven/src/program/program.py", line 322, in _process_future_item
    for _item in future.result():
  File "/riven/src/program/db/db_functions.py", line 107, in _run_thread_with_db_item
    for res in fn(item):
  File "/riven/src/program/scrapers/__init__.py", line 83, in run
    sorted_streams = self.scrape(item)
                     ^^^^^^^^^^^^^^^^^
  File "/riven/src/program/scrapers/__init__.py", line 123, in scrape
    sorted_streams: Dict[str, Stream] = _parse_results(item, results)
                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/riven/src/program/scrapers/shared.py", line 125, in _parse_results
    item.blacklisted_streams.append(stream)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'append'

Traceback (most recent call last):

  File "/riven/src/program/program.py", line 322, in _process_future_item
    for _item in future.result():
                 β”‚      β”” <function Future.result at 0x7f1f420b4860>
                 β”” <Future at 0x7f1f35e7f210 state=finished returned generator>

  File "/riven/src/program/db/db_functions.py", line 107, in _run_thread_with_db_item
    for res in fn(item):
               β”‚  β”” Movie:Inside Out 2:Indexed
               β”” <bound method Scraping.run of <program.scrapers.Scraping object at 0x7f1f39a5f110>>

  File "/riven/src/program/scrapers/__init__.py", line 83, in run
    sorted_streams = self.scrape(item)
                     β”‚    β”‚      β”” Movie:Inside Out 2:Indexed
                     β”‚    β”” <function Scraping.scrape at 0x7f1f39e3e520>
                     β”” <program.scrapers.Scraping object at 0x7f1f39a5f110>

  File "/riven/src/program/scrapers/__init__.py", line 123, in scrape
    sorted_streams: Dict[str, Stream] = _parse_results(item, results)
                    β”‚         β”‚         β”‚              β”‚     β”” {'1f3f160ebfa440c917a1d200c9a406f189da49a6': 'Inside Out 2 2024 1080p Telesync x264 Dual YG mkv', '93953b7ffaf4dda7f23870968a...
                    β”‚         β”‚         β”‚              β”” Movie:Inside Out 2:Indexed
                    β”‚         β”‚         β”” <function _parse_results at 0x7f1f39fd23e0>
                    β”‚         β”” <class 'program.media.stream.Stream'>
                    β”” typing.Dict

  File "/riven/src/program/scrapers/shared.py", line 125, in _parse_results
    item.blacklisted_streams.append(stream)
    β”‚    β”‚                          β”” <Stream #139771964175248
    β”‚    β”‚                             _id = None
    β”‚    β”‚                             infohash = '9e61a4bb028a12bc00cc3b0a41638776c3c272a6'
    β”‚    β”‚                             raw_title = 'Inside Out 2 (2024)...
    β”‚    β”” <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f1f3b826200>
    β”” Movie:Inside Out 2:Indexed

AttributeError: 'NoneType' object has no attribute 'append'
24-08-01 13:42:25 | πŸ€– PROGRAM   | program._remove_from_running_items - Item Inside Out 2 finished running section Scraping
dreulavelle commented 3 months ago

This should be fixed, but let me know in discord if it happens again!