Prudhvi-pln / udb

Introducing UDB: Your One-Stop Solution for Effortless Anime, Drama, Movies, TV Shows Downloads. UDB is a powerful and user-friendly download utility specifically designed for anime, drama, tv-series enthusiasts. It empowers you to effortlessly download entire series at once, saving you precious time and frustration.
MIT License
8 stars 6 forks source link

Few errors with new build #21

Open ZetsApocNow opened 1 week ago

ZetsApocNow commented 1 week ago

Select type of series: 1: Anime (Gogoanime) 2: Anime (Animepahe) 3: Drama (Myasiantv) 4: Movies & TV Shows (Vidsrc) 5: Movies & TV Shows (Superembed)

Enter your choice: 4 C:\udb\Clients\BaseClient.py:182: SyntaxWarning: invalid escape sequence '\d' resolutions = _regex_list(master_m3u8_data, 'RESOLUTION=(\d+x\d+)', 1) C:\udb\Clients\BaseClient.py:684: SyntaxWarning: invalid escape sequence '\d' is_match = lambda word: re.search('\d+.\d+.\d+.\d+', word) Error occurred: No module named 'distutils'. Check log for more details.

Ready for one more? Reload UDB (y|n)?

Select type of series: 1: Anime (Gogoanime) 2: Anime (Animepahe) 3: Drama (Myasiantv) 4: Movies & TV Shows (Vidsrc) 5: Movies & TV Shows (Superembed)

Enter your choice: 5 Error occurred: No module named 'distutils'. Check log for more details.

Ready for one more? Reload UDB (y|n)?

Prudhvi-pln commented 1 week ago

That's strange. It looks more like an installation issue. Did you change / update your python ? Try this: https://github.com/Uberi/speech_recognition/issues/732

FYI, It is working fine for me: image

ZetsApocNow commented 1 week ago

Alright, I applied the fix from the link, tried again, said Superembed requires Chrome, installed that. Now, on 4, it just says "Invalid vidsrc keys" - which I guess is to be expected as per your explanation of the cause, but on 5 I'm getting no luck either - shown below

Select type of series:
1: Anime (Gogoanime)
2: Anime (Animepahe)
3: Drama (Myasiantv)
4: Movies & TV Shows (Vidsrc)
5: Movies & TV Shows (Superembed)

Enter your choice: 5

Enter series/movie name: charmed

Search Results:
1: Charmed | Language: English | Genre: Comedy, Drama, Mystery, Sci-Fi & Fantasy
   | Type: TV Show | User Score: 82% | Released: 1998 | Status: Ended
   | Seasons: 8 | Total Episodes: 178
2: Charmed | Language: English | Genre: Drama, Sci-Fi & Fantasy
   | Type: TV Show | User Score: 73% | Released: 2018 | Status: Canceled
   | Seasons: 4 | Total Episodes: 72
3: Beautiful Charm (Yahşi Cazibe) | Language: Turkish | Genre: Comedy, Family
   | Type: TV Show | User Score: 53% | Released: 2010 | Status: Ended
   | Seasons: 2 | Total Episodes: 93
4: Second Time is a Charm (第二次也很美) | Language: Chinese | Genre:
   | Type: TV Show | User Score: 30% | Released: 2019 | Status: Ended
   | Seasons: 1 | Total Episodes: 57
5: Charmsukh | Language: Hindi | Genre: Drama
   | Type: TV Show | User Score: 60% | Released: 2019 | Status: Returning Series
   | Seasons: 1 | Total Episodes: 56

Enter 0 to search with different key word

Select one of the above: 1

Available Episodes Details: 178 episodes found.
Enter seasons range to display (ex: 1-16) [default=1-8]: 3
Showing episodes for seasons [3 - 3]:
-------------- Season: 3 --------------
Season: 03 | Charmed - S03E01
Season: 03 | Charmed - S03E02
Season: 03 | Charmed - S03E03
Season: 03 | Charmed - S03E04
Season: 03 | Charmed - S03E05
Season: 03 | Charmed - S03E06
Season: 03 | Charmed - S03E07
Season: 03 | Charmed - S03E08
Season: 03 | Charmed - S03E09
Season: 03 | Charmed - S03E10
Season: 03 | Charmed - S03E11
Season: 03 | Charmed - S03E12
Season: 03 | Charmed - S03E13
Season: 03 | Charmed - S03E14
Season: 03 | Charmed - S03E15
Season: 03 | Charmed - S03E16
Season: 03 | Charmed - S03E17
Season: 03 | Charmed - S03E18
Season: 03 | Charmed - S03E19
Season: 03 | Charmed - S03E20
Season: 03 | Charmed - S03E21
Season: 03 | Charmed - S03E22

Enter seasons to download (ex: 1-16) [default=1-8]: 3

Download entire season(s) (y|n)? y

Fetching Episodes & Available Resolutions:
-------------- Season: 3 --------------
Error occurred: too many values to unpack (expected 2). Check log for more details.

Ready for one more? Reload UDB (y|n)?

In the log it states

2024-06-29 00:10:50,521 - INFO - <module>:373 - -------------------------------- NEW UDB INSTANCE v2.13.0 --------------------------------
2024-06-29 00:10:50,522 - INFO - <module>:375 - CLI options: Namespace(conf='config_udb.yaml', version=False, series_type=None, series_name=None, series_year=None, seasons=None, episodes=None, resolution=None, start_download=False, disable_colors=False, hls_size_accuracy=0, update=False)
2024-06-29 00:10:51,543 - INFO - <module>:379 - Selected Series type: Movies & TV Shows (Superembed)
2024-06-29 00:10:51,884 - INFO - <module>:383 - Client: <Clients.SuperembedClient.SuperembedClient object at 0x000001B10343B620>
2024-06-29 00:10:54,072 - INFO - search_and_select_series:106 - Searching with keyword: charmed
2024-06-29 00:10:58,057 - INFO - search_and_select_series:108 - Search Results Found
2024-06-29 00:10:58,770 - INFO - <module>:397 - Selected series: {'title': 'Charmed', 'link': 'https://www.themoviedb.org//tv/1981-charmed?language=en-US', 'Status': 'Ended', 'Network': 'Network', 'Type': 'Scripted', 'Original Language': 'English', 'genre': 'Comedy, Drama, Mystery, Sci-Fi & Fantasy', 'score': '82', 'year': '1998', 'show_id': '1981', 'type': 'tv', 'seasons': 8, 'episodes': 178, 'episodes_per_season': {'Specials': '14', 'Season 1': '22', 'Season 2': '22', 'Season 3': '22', 'Season 4': '22', 'Season 5': '23', 'Season 6': '23', 'Season 7': '22', 'Season 8': '22'}}
2024-06-29 00:10:58,771 - INFO - <module>:400 - Fetching episodes list
2024-06-29 00:11:36,299 - INFO - <module>:409 - Displaying episodes list
2024-06-29 00:11:48,085 - INFO - <module>:419 - Fetching episodes based on selected_eps = {3: {'start': 1, 'end': 22}}
2024-06-29 00:11:49,285 - INFO - patch_exe:346 - patching driver executable C:\Users\theda\appdata\roaming\undetected_chromedriver\undetected_chromedriver.exe
2024-06-29 00:11:50,200 - INFO - _configure_headless:493 - setting properties for headless
2024-06-29 00:11:52,657 - ERROR - <module>:512 - Error occurred: too many values to unpack (expected 2). Check log for more details.
2024-06-29 00:11:52,658 - WARNING - <module>:513 - Stacktrace: Traceback (most recent call last):
  File "C:\udb\Clients\SuperembedClient.py", line 333, in fetch_episode_links
    m3u8_links, subtitles = self._resolve_vipstream_source(link)
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\udb\Clients\SuperembedClient.py", line 207, in _resolve_vipstream_source
    lang, url = sub.split(']')
    ^^^^^^^^^
ValueError: too many values to unpack (expected 2)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\udb\udb.py", line 421, in <module>
    target_ep_links = client.fetch_episode_links(episodes, selected_eps)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\udb\Clients\SuperembedClient.py", line 344, in fetch_episode_links
    raise Exception(e)          # propagate the exception as-is
    ^^^^^^^^^^^^^^^^^^
Exception: too many values to unpack (expected 2)
Prudhvi-pln commented 6 days ago

Updated the code with required fix. Also, updated Vidsrc client with reliable keys source (which updates every hour). Please check and kindly let me know if you see any other issues.

ZetsApocNow commented 6 days ago

Was getting errors, decided to delete all I had and redownload fully, errors still present. Intermittent regex issues present with /d and /g

Option 1 seems to work well and completes Option 2 seems to work well and completes Option 3 again has regex issues but works through it and completes Option 4 seems to work well and completes, tested multiple times, regex issues show sometimes Option 5 errors out

Enter seasons to download (ex: 1-16) [default=1-3]: 1

Download entire season(s) (y|n)? n

Enter Season-1 episodes to download (ex: 1-16) [default=1-24]: 1-5

Fetching Episodes & Available Resolutions:
-------------- Season: 1 --------------
Failed to extract stream source link for source: vipstream. Error: 'NoneType' object has no attribute 'get'
Failed to extract stream source link for source: vipstream. Error: 'NoneType' object has no attribute 'get'
Failed to extract stream source link for source: vipstream. Error: 'NoneType' object has no attribute 'get'
Failed to extract stream source link for source: vipstream. Error: 'NoneType' object has no attribute 'get'
Failed to extract stream source link for source: vipstream. Error: 'NoneType' object has no attribute 'get'
No episodes are available for download!

Also I want to mention that a lot of errors surface if using multiple instances of the script, either writing to log issues or other. I prevented them before by removing some logger tidbits in the scripts and could run 4/5 at a time without issue.

For example, running 2 starts giving me errors like this and they appear on 3 obviously

I made changes involving this I think in udb.py, but I'm sure there's a better way to do things.

image

--- Logging error ---
Traceback (most recent call last):
  File "C:\Users\theda\AppData\Local\Programs\Python\Python312\Lib\logging\handlers.py", line 74, in emit
    self.doRollover()
  File "C:\Users\theda\AppData\Local\Programs\Python\Python312\Lib\logging\handlers.py", line 179, in doRollover
    self.rotate(self.baseFilename, dfn)
  File "C:\Users\theda\AppData\Local\Programs\Python\Python312\Lib\logging\handlers.py", line 115, in rotate
    os.rename(source, dest)
PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'P:\\udb\\log\\udb.log' -> 'P:\\udb\\log\\udb.log.1'
Call stack:
  File "P:\udb\udb.py", line 396, in <module>
    target_series = search_and_select_series(series_name_predef, series_year_predef)
  File "P:\udb\udb.py", line 108, in search_and_select_series
    logger.info('Search Results Found')
Message: 'Search Results Found'
Arguments: ()

From my understanding it fails when trying to write/read the log simultaneously with another instance, preventing the write stops all issues but it isn't exactly a safe way to do things as it gains the inability to debug. So hopefully you can come up with a fix for it as this script really shines when you have 3/4 going at once for full efficiency.

Prudhvi-pln commented 6 days ago

Oh, thanks for the detailed information 🙂.

So, there are 3 issues:

  1. Regex warnings
  2. Failures in Superembed
  3. Ability to run multiple instances of udb

For issue-1, it is not happening for me. Can you share the python & pip versions you are using? For issue-2, I could not recreate it. But my guess is that there is a captcha which pops-up intermittently, which might be causing it. I'll try to recreate it and find a solution. For issue-3, yes, current UDB is meant to run as one instance (becoz it internally use parallel processing during downloads, so your cpu and internet bandwidth is highly utilized) and uses one log file. In order to run multiple instances, will need to modify the code a bit. I'll consider this as a new feature.

While I investigate 2, please use option-4 (vidsrc), as it is more reliable now. In case you see the same invalid keys error, just retry after an hour.

ZetsApocNow commented 6 days ago

pip 24.0 python 3.12