k0rnh0li0 / onlyfans-dl

OnlyFans content downloader
GNU General Public License v3.0
772 stars 221 forks source link

TypeError: expected string or bytes-like object #250

Closed parkss87 closed 8 months ago

parkss87 commented 11 months ago

Getting the following message with just one account. Starts to download and then stops

Traceback (most recent call last):stimated Time left: 0:00:00, Estimated finish time: 21:39:15
  File "onlyfans-dl.py", line 427, in <module>
    cur_count = download_posts(1, photo_posts, False)
  File "onlyfans-dl.py", line 281, in download_posts
    download_media(media, is_archived)
  File "onlyfans-dl.py", line 222, in download_media
    ext = re.findall('\.\w+\?', source)
  File "D:\Program Files\Python\Python36-32\lib\re.py", line 222, in findall
    return _compile(pattern, flags).findall(string)
TypeError: expected string or bytes-like object
m-a-x-c commented 10 months ago

I am getting the same error.

Media already present will not be re-downloaded.
Saving profile info...
Finding photos... Found 40 photos.
Finding videos... Found 47 videos.
Finding archived content... Found 0 archived posts.
Found 87 posts. Downloading media...
Traceback (most recent call last):stimated Time left: 0:00:00, Estimated finish time: 02:06:20
  File "E:\Lewds\OnlyFans\New folder\onlyfans-dl-master\onlyfans-dl.py", line 428, in <module>
    cur_count = download_posts(cur_count, video_posts, False)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "E:\Lewds\OnlyFans\New folder\onlyfans-dl-master\onlyfans-dl.py", line 281, in download_posts
    download_media(media, is_archived)
  File "E:\Lewds\OnlyFans\New folder\onlyfans-dl-master\onlyfans-dl.py", line 222, in download_media
    ext = re.findall('\.\w+\?', source)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\oven\AppData\Local\Programs\Python\Python311\Lib\re\__init__.py", line 216, in findall
    return _compile(pattern, flags).findall(string)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: expected string or bytes-like object, got 'NoneType'
vaultah commented 10 months ago

Skip DRM content by adding

if source is None:
    return

immediately before the

ext = re.findall('\.\w+\?', source)

line, or use a different downloader.

m-a-x-c commented 10 months ago

Skip DRM content by adding

if source is None:
    return

immediately before the

ext = re.findall('\.\w+\?', source)

line, or use a different downloader.

Thanks! That worked.

However, are you familiar with any repos which can bypass DRM?

junobite commented 10 months ago

Might be slightly more complicated to setup for some people but this works and downloads DRM protected content https://github.com/sim0n00ps/OF-DL