Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix Drive Links
  • Loading branch information
Rajesh Gundupalli authored and Rajesh Gundupalli committed Apr 5, 2019
commit 175f4993664609a5bbd30695d6bd4319d7ae889b
2 changes: 2 additions & 0 deletions .idea/PythonScripts.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions NewsPaperDownloaderV2.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from bs4 import BeautifulSoup

#URL which contain GDrive link of Hindhu Paper
URL = "https://www.bitul.in/epaper/the-hindu/"
URL = "https://www.bitul.in/epaper/the-hindu/" #"https://www.bitul.in/epaper/indian-express-pdf/"
r = requests.get(URL)

soup = BeautifulSoup(r.content, 'html5lib')
Expand All @@ -29,7 +29,8 @@
if f==0:
Id = drivelink[32:65]
file_url = "https://drive.google.com/uc?authuser=0&id="+Id+"&export=download"
file_url = drivelink
else:
file_url = drivelink
r = requests.get(file_url, stream = True)
with open("resources/NewsPaper/NewsPaper.pdf","wb") as pdf:
for chunk in r.iter_content(chunk_size=1024):
Expand Down
5 changes: 3 additions & 2 deletions NewsPaperSender.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import requests
import html5lib
#import html5lib
from bs4 import BeautifulSoup
import smtplib
from email.mime.multipart import MIMEMultipart
Expand Down Expand Up @@ -39,7 +39,8 @@
if f==0:
Id = drivelink[32:65]
file_url = "https://drive.google.com/uc?authuser=0&id="+Id+"&export=download"
file_url = drivelink
else:
file_url = drivelink
r = requests.get(file_url, stream = True)
with open("C:/Users/Rajesh.Gundupalli/Desktop/PythonScripts/resources/NewsPaper/NewsPaper.pdf","wb") as pdf:
for chunk in r.iter_content(chunk_size=1024):
Expand Down