- filename = video['title']+".flv"
- print(Popen(["mplayer","-dumpstream","-dumpfile",filename, rtmp], stdout=PIPE).communicate()[0])
- if not 'timestamp' in video:
- if soup.find_all(datetime=True):
- xmldate_str = soup.find_all(datetime=True)[0].attrs['datetime']
- video['timestamp'] = datetime(*feedparser._parse_date_w3dtf(xmldate_str)[:6]) #naive in utc
- video['timestamp'] = video['timestamp'].replace(tzinfo=timezone.utc).astimezone(tz=None) #convert to local time
+ filename = Path(video['title']).with_suffix(".flv")
+ print(Popen(["mplayer", "-dumpstream", "-dumpfile", filename, rtmp], stdout=PIPE).communicate()[0])
+ if not 'timestamp' in video and soup.find_all(datetime=True):
+ xmldate_str = soup.find_all(datetime=True)[0].attrs['datetime']
+ if xmldate_str:
+ video['timestamp'] = datetime(*feedparser._parse_date_w3dtf(xmldate_str)[:6]) # naive in utc
+ video['timestamp'] = video['timestamp'].replace(tzinfo=timezone.utc).astimezone(tz=None) # convert to local time