fixbug type file

This commit is contained in:
Andros Fenollosa 2017-04-18 19:32:11 +02:00
parent c70ed2bbf5
commit 7b2c882f66

View File

@ -1,16 +1,16 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from os import path, walk, remove, rename
from imghdr import what
from subprocess import call
from sys import argv
top_dir = argv[1]
TEMP_FILE = 'temp.jpg'
extensions = ('jpeg', 'jpg')
TYPES = ('jpeg',)
for dirpath, dirnames, files in walk(top_dir):
for name in files:
for extension in extensions:
if name.lower().endswith(extension):
if what(path.join(dirpath, name)) in TYPES:
# Get urls
url = path.join(dirpath, name)
print(url)