def test_issue_094(self): """Thanks to @jeanmarctst for raising this issue. Make sure caption is properly extracted from images downloaded from a post code and written to the metadata. """ looter = PostLooter("BY77tSfBnRm", add_metadata=True, template='{code}', session=self.session) looter.download(self.destfs) metadata = piexif.load(self.destfs.getbytes("BY77tSfBnRm.jpg"), True) self.assertTrue(metadata['Exif']['UserComment'])
def test_issue_009(self): """ Thanks to @kurtmaia for reporting this bug. Checks that adding metadata to pictures downloaded from a hashtag works as well. """ looter = ProfileLooter("fluoxetine", add_metadata=True, session=self.session) looter.download(self.destfs, media_count=10) for f in self.destfs.listdir("/"): exif = piexif.load(self.destfs.getbytes(f)) self.assertTrue(exif['Exif']) # Date & Caption self.assertTrue(exif['0th']) # Image creator
def test_issue_009(self): """ Thanks to @kurtmaia for reporting this bug. Checks that adding metadata to pictures downloaded from a hashtag works as well. """ looter = HashtagLooter("fluoxetine", add_metadata=True, session=self.session) with contexter.Contexter() as ctx: ctx << mock.patch.object(looter, 'pages', MockPages('fluoxetine')) looter.download(self.destfs, media_count=10) for f in self.destfs.listdir("/"): exif = piexif.load(self.destfs.getbytes(f)) self.assertTrue(exif['Exif']) # Date & Caption self.assertTrue(exif['0th']) # Image creator