2hands10fingers / Reddit-Image-Scraper-1.0

Scrapes/downloads a selected subreddit's posted images by a specified date range on http://reddit.com
http://www.glotacosm.com
48 stars 13 forks source link

OSError: [Errno 36] File name too long: #24

Open klimli opened 6 years ago

klimli commented 6 years ago

There are better ways to handle it for sure but for my own use I added:

url_only = str(url).split('/')[-1] filename = date_created + url_only filename = filename[:9] + filename[int(len(url_only)/3):] it cuts the name from the URL to 1/3 on line 270