Limit cyanideandhappiness filename length

This commit is contained in:
Bastian Kleineidam 2014-01-05 11:08:15 +01:00
parent 9172aba146
commit d9edeb1343

View file

@ -435,10 +435,13 @@ class CyanideAndHappiness(_BasicScraper):
self.stripUrl % "3360", # video
self.stripUrl % "3367", # video
self.stripUrl % "3382", # video
self.stripUrl % "3421", # video
)
@classmethod
def namer(cls, imageUrl, pageUrl):
imgname = imageUrl.split('/')[-1]
# only get the first 100 chars for the image name
imgname = imgname[:100]
imgnum = pageUrl.split('/')[-2]
return '%s_%s' % (imgnum, imgname)