在動畫瘋的頁面可針對影片(不含彈幕)擷圖。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| from __future__ import annotations | |
| import json | |
| class CompactJSONEncoder(json.JSONEncoder): | |
| """A JSON Encoder that puts small containers on single lines.""" | |
| CONTAINER_TYPES = (list, tuple, dict) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| from PIL import Image | |
| def extractFrames(inGif, outFolder): | |
| frame = Image.open(inGif) | |
| nframes = 0 | |
| while frame: | |
| frame.save( '%s/%s-%s.gif' % (outFolder, os.path.basename(inGif), nframes ) , 'GIF') | |
| nframes += 1 |
