Skip to content

Instantly share code, notes, and snippets.

@greatvc
greatvc / checkvideos.py
Last active November 16, 2015 08:56
Check videos if they are corrupted at the end by seeking to 99% of the video. Return true if it is corrupted.
#!/usr/bin/python
import os
import sys
MyVideo=""
def checkfile(filename):
command = "echo 'seek 99 1' | mplayer -slave -msglevel all=4 -benchmark -vo null -nosound \"" + filename + "\" 2>&1"
output = os.popen(command).read()
@greatvc
greatvc / SendEmail.py
Created November 16, 2015 08:57
Send email of corrupted.txt if videos are found inside. Great tool for notifying you for corrupted videos.
#!/usr/bin/python
import os
import sys
import smtplib
if os.stat('path to Corrupted.txt').st_size == 0:
sys.exit()
from email.MIMEMultipart import MIMEMultipart