Skip to content

Commit

Permalink
Pequenas correções
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaslattari committed Dec 28, 2019
1 parent 64c07eb commit 21e23e9
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 10 deletions.
Binary file modified __pycache__/packages.cpython-37.pyc
Binary file not shown.
Binary file modified __pycache__/podcast.cpython-37.pyc
Binary file not shown.
Binary file modified __pycache__/scrapping.cpython-37.pyc
Binary file not shown.
Binary file modified __pycache__/video.cpython-37.pyc
Binary file not shown.
4 changes: 1 addition & 3 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
logging.getLogger("tensorflow").setLevel(logging.ERROR)

import scrapping as scrap
import translateNews as trans
import textgeneration as tg
import podcast as pod
import translateNews as trans
from pydub import AudioSegment
import video
import youtube as yt
Expand Down Expand Up @@ -82,7 +81,6 @@ def main():
os.remove("mp3files")
os.remove("gpt2.vbs")
os.remove("final.mp4")
os.remove("final.avi")
os.remove("temp.wav")
for _, _, files in os.walk('.'):
for filename in files:
Expand Down
4 changes: 1 addition & 3 deletions packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ def installTorch():
installModule("html5lib")
installModule("pickle-mixin")
installModule("translate")
#installModule("gTTS")
installModule("google-cloud-texttospeech")
installModule("gTTS")
installModule("tensorflow==1.15")
installModule("tensorflow-gpu==1.15")
installModule("transformers")
Expand All @@ -32,7 +31,6 @@ def installTorch():
installModule("scikit-learn")
installTorch()
installModule("librosa")
installModule("opencv-python")
installModule("moviepy")
installModule("google-api-python-client")
installModule("http.client")
Expand Down
2 changes: 2 additions & 0 deletions podcast.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
from os import path
import stringUtils as s
from pydub import *
import translateNews as trans
import textgeneration as tg

def generatePodcastDialogMP3Files(dialogName):
ff = open(dialogName, "r")
Expand Down
9 changes: 6 additions & 3 deletions scrapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ def extractTextFromNews(dictionary, saveFileInDir):
if len(divHeader) == 0:
divHeader = soup.findAll('div', {"class": "l-root l-reskin"})
for eachDiv in divHeader:

#pega título da matéria
h1HeaderTitle = eachDiv.findAll('h1', {"class": "c-page-title"})
for eachH1 in h1HeaderTitle:
Expand All @@ -122,8 +121,12 @@ def extractTextFromNews(dictionary, saveFileInDir):

#pega autor da matéria
spanHeaderTitle = eachDiv.find('span', {"class": "c-byline__item"})
dictionaryOfArticles[iterations]["autor"] = spanHeaderTitle.find("a").text
logging.debug(spanHeaderTitle.find("a").text)
if spanHeaderTitle.find("a") is not None:
logging.debug(spanHeaderTitle.find("a"))
dictionaryOfArticles[iterations]["autor"] = spanHeaderTitle.find("a").text
else:
logging.debug(spanHeaderTitle.text)
dictionaryOfArticles[iterations]["autor"] = spanHeaderTitle.text

#pega data da publicacao
time = eachDiv.find('time', {"class": "c-byline__item"}).text.replace(" ", "")
Expand Down
2 changes: 1 addition & 1 deletion video.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# coding: utf-8
import cv2
import numpy as np
import time
import re
Expand All @@ -8,6 +7,7 @@
import logging
from pydub import AudioSegment
import moviepy.editor as mp
import cv2

def showImage(frame):
cv2.imshow('imagem exibida', frame)
Expand Down

0 comments on commit 21e23e9

Please sign in to comment.