import random
import shout
import urllib
+import mimetypes
from threading import Thread
from __init__ import *
self.counter = 0
self.command = 'cat '
self.delay = 0
+ self.start_time = time.time()
# Media
self.media_dir = self.station['media']['dir']
self.twitter_key = self.station['twitter']['key']
self.twitter_secret = self.station['twitter']['secret']
self.twitter_tags = self.station['twitter']['tags'].split(' ')
+ try:
+ self.twitter_messages = self.station['twitter']['message']
+ if isinstance(self.twitter_messages, dict):
+ self.twitter_messages = list(self.twitter_messages)
+ except:
+ pass
+
if self.twitter_mode == 1:
self.twitter_callback('/twitter', [1])
media_objs = []
for media in media_list:
file_name, file_title, file_ext = get_file_info(media)
- if file_ext.lower() == 'mp3':
+ if file_ext.lower() == 'mp3' and mimetypes.guess_type(media)[0] == 'audio/mpeg':
media_objs.append(Mp3(media))
- elif file_ext.lower() == 'ogg':
+ elif file_ext.lower() == 'ogg' and mimetypes.guess_type(media)[0] == 'audio/ogg':
media_objs.append(Ogg(media))
return media_objs
<key>your access token key</key>
<secret>your access token secret key</secret>
<tags>bla bla</tags>
+ <message>
+ <text>hello world !</text>
+ <period>30</period>
+ </message>
</twitter>
<jingles>
<mode>0</mode>
'''The setup and build script for the python-twitter library.'''
import os
+from distutils.core import setup
from deefuzzer import __version__
__author__ = 'yomguy@parisson.com'
+with open('README.rst') as file:
+ long_description = file.read()
+
# The base package metadata to be used by both distutils and setuptools
METADATA = dict(
name = "DeeFuzzer",
include_package_data = True,
scripts=['scripts/deefuzzer'],
classifiers = ['Programming Language :: Python', 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', 'Topic :: Multimedia :: Sound/Audio', 'Topic :: Multimedia :: Sound/Audio :: Players',],
+ long_description=long_description,
)
-
def Main():
# Use setuptools if available, otherwise fallback and use distutils
try:
except ImportError:
import distutils.core
distutils.core.setup(**METADATA)
-
-
+
if __name__ == '__main__':
Main()