-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpodcast.py
More file actions
executable file
·48 lines (40 loc) · 1.86 KB
/
podcast.py
File metadata and controls
executable file
·48 lines (40 loc) · 1.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/bin/env python
import rss_gen
import common
import chatzinikolaou
import logging
import ellinofreneia
def main():
logging.basicConfig(filename = 'podcast.log', \
format = '%(asctime)s %(message)s', level = logging.INFO)
cmn = common.common_functions()
chatz = chatzinikolaou.chatzinikolaou_functions()
url_chatz = cmn.config_section_map("chatzinikolaou")['url']
if chatz.chatz_is_file_downloaded() == False:
cmn.ensure_directory_structure('chatzinikolaou')
main_page_html = cmn.get_html_and_split_lines(url_chatz)
chatz_download_url = chatz.find_actual_download_url(main_page_html)
download_page_html = cmn.get_html_and_split_lines(chatz_download_url)
cmn.download_all_available_files(download_page_html, 'chatzinikolaou')
cmn.concat_files_and_move("chatzinikolaou")
rssgen = rss_gen.RssGenerator()
rssgen.createxml("chatzinikolaou")
logging.info("New chatzinikolaou episode file found and podcast updated")
else:
logging.info("Exiting")
ellin = ellinofreneia.ellinofreneia_functions()
ellin_chatz = cmn.config_section_map("ellinofreneia")['url']
if ellin.ellin_is_file_downloaded() == False:
cmn.ensure_directory_structure('ellinofreneia')
main_page_html = cmn.get_html_and_split_lines(ellin_chatz)
ellin_download_url = ellin.find_actual_download_url(main_page_html)
download_page_ellin_html = cmn.get_html_and_split_lines(ellin_download_url)
cmn.download_all_available_files(download_page_ellin_html, 'ellinofreneia')
cmn.concat_files_and_move("ellinofreneia")
rssgen = rss_gen.RssGenerator()
rssgen.createxml("ellinofreneia")
logging.info("New ellinofreneia episode file found and podcast updated")
else:
logging.info("Exiting")
if __name__ == '__main__':
main()