Ejemplo n.º 1
0
from mutagen.mp3 import MP3
from gramafon.utils.id3.handler import *
import time
import logging
from watchdog.events import LoggingEventHandler

sys.path.append(abspath(dirname(dirname(getcwd()))))
sys.path.append(abspath(dirname(dirname(dirname(getcwd())))))
os.environ['DJANGO_SETTINGS_MODULE'] = 'gramafon.settings'

from django.conf import settings
from gramafon.web.models import File, Singer, Album, Song
from gramafon.utils.id3.handler import MP3FileInfo as ID3Manager
from gramafon.utils.logger import Logger

logger = Logger()

soap = LyricWiki_services.LyricWikiBindingSOAP(
    "http://lyrics.wikia.com/server.php")  #added to get song lyrics
songlyric = LyricWiki_services.getSongRequest()

logger.message("Path: %s" % settings.ARCHIEVE_PATH)
for root, dirs, files in os.walk(settings.ARCHIEVE_PATH):
    for f in files:

        prefix, fileExtension = os.path.splitext(f)
        if fileExtension[1:] not in list(settings.MEDIA_FORMATS):
            continue

        path = os.path.join(root, f)
        md5 = hashlib.md5(open(path, 'r').read()).hexdigest()
Ejemplo n.º 2
0
sys.path.append(dirname(dirname(getcwd())))
from mutagen.flac import FLAC #Flac  
from mutagen.apev2 import APEv2
from mutagen.mp3 import MP3
import time
import logging
from watchdog.events import LoggingEventHandler

sys.path.append(abspath(dirname(dirname(getcwd()))))
sys.path.append(abspath(dirname(dirname(dirname(getcwd())))))
os.environ['DJANGO_SETTINGS_MODULE'] = 'gramafon.settings'

from django.conf import settings
from gramafon.utils.logger import Logger

logger = Logger()
for root, dirs, files in os.walk(settings.ARCHIEVE_PATH):
    for f in files:

        prefix, fileExtension = os.path.splitext(f)
        if fileExtension[1:] not in list(settings.MEDIA_FORMATS):
            continue

        path = os.path.join(root, f)
	music = pyglet.media.load(path) #You need to install libavbin-dev
	player=media.Player()
    	player.queue(music)
    	player.play()
    	try:
		logger.message("\tNow: %s" % f)
		logger.message("\tLength: %s bayt" % music.duration) # music.duration is the song length	
Ejemplo n.º 3
0
from mutagen.mp3 import MP3
from gramafon.utils.id3.handler import *
import time
import logging
from watchdog.events import LoggingEventHandler

sys.path.append(abspath(dirname(dirname(getcwd()))))
sys.path.append(abspath(dirname(dirname(dirname(getcwd())))))
os.environ['DJANGO_SETTINGS_MODULE'] = 'gramafon.settings'

from django.conf import settings
from gramafon.web.models import File,Singer,Album, Song
from gramafon.utils.id3.handler import MP3FileInfo as ID3Manager
from gramafon.utils.logger import Logger

logger = Logger()

soap = LyricWiki_services.LyricWikiBindingSOAP("http://lyrics.wikia.com/server.php") #added to get song lyrics
songlyric = LyricWiki_services.getSongRequest()

logger.message("Path: %s" % settings.ARCHIEVE_PATH)
for root, dirs, files in os.walk(settings.ARCHIEVE_PATH):
    for f in files:

        prefix, fileExtension = os.path.splitext(f)
        if fileExtension[1:] not in list(settings.MEDIA_FORMATS):
            continue

        path = os.path.join(root, f)
	md5=hashlib.md5(open(path, 'r').read()).hexdigest()
	sha1=hashlib.sha1(open(path, 'rb').read()).hexdigest()