Update 测绘站采集.py

This commit is contained in:
frxz751113
2024-09-13 15:31:47 +08:00
committed by GitHub
parent 7b06f0f92a
commit c7e1e5188e
+4 -4
View File
@@ -469,7 +469,7 @@ txt_to_m3u('综合源.txt', '综合源.m3u')
import datetime import datetime
now = datetime.datetime.utcnow() + datetime.timedelta(hours=8) now = datetime.datetime.utcnow() + datetime.timedelta(hours=8)
current_time = now.strftime("%m-%d %H") #:%M current_time = now.strftime("%m/%d %H") #:%M
# 打开文本文件并将时间添加到开头 # 打开文本文件并将时间添加到开头
file_path = "综合源.m3u" file_path = "综合源.m3u"
with open(file_path, 'r+', encoding='utf-8') as f: with open(file_path, 'r+', encoding='utf-8') as f:
@@ -478,7 +478,7 @@ with open(file_path, 'r+', encoding='utf-8') as f:
f.write(f'{content}\n') f.write(f'{content}\n')
#f.write(f'#EXTINF:-1 group-title="更新时间",请您欣赏\n') #f.write(f'#EXTINF:-1 group-title="更新时间",请您欣赏\n')
#f.write(f'http://em.21dtv.com/songs/60144971.mkv\n') #f.write(f'http://em.21dtv.com/songs/60144971.mkv\n')
f.write(f'#EXTINF:-1 group-title="{current_time}更新",虚情的爱\n') f.write(f'#EXTINF:-1 group-title="{current_time}:00更新",虚情的爱\n')
f.write(f'https://vd2.bdstatic.com/mda-mi1dd05gmhwejdwn/sc/cae_h264/1630576203346678103/mda-mi1dd05gmhwejdwn.mp4\n') f.write(f'https://vd2.bdstatic.com/mda-mi1dd05gmhwejdwn/sc/cae_h264/1630576203346678103/mda-mi1dd05gmhwejdwn.mp4\n')
#任务结束,删除不必要的过程文件# #任务结束,删除不必要的过程文件#
@@ -766,7 +766,7 @@ for line in fileinput.input("综合源.txt", inplace=True): #打开临时文
import datetime import datetime
now = datetime.datetime.utcnow() + datetime.timedelta(hours=8) now = datetime.datetime.utcnow() + datetime.timedelta(hours=8)
current_time = now.strftime("%m-%d %H:%M") current_time = now.strftime("%m/%d %H:00") #%M
# 打开文本文件并将时间添加到开头 # 打开文本文件并将时间添加到开头
file_path = "综合源.txt" file_path = "综合源.txt"
with open(file_path, 'r+', encoding='utf-8') as f: with open(file_path, 'r+', encoding='utf-8') as f:
@@ -775,7 +775,7 @@ with open(file_path, 'r+', encoding='utf-8') as f:
f.write(f'{content}\n') f.write(f'{content}\n')
#f.write(f'更新时间,#genre#\n') #f.write(f'更新时间,#genre#\n')
#f.write(f'请您欣赏,https://vd2.bdstatic.com/mda-mi1dd05gmhwejdwn/sc/cae_h264/1630576203346678103/mda-mi1dd05gmhwejdwn.mp4\n') #f.write(f'请您欣赏,https://vd2.bdstatic.com/mda-mi1dd05gmhwejdwn/sc/cae_h264/1630576203346678103/mda-mi1dd05gmhwejdwn.mp4\n')
f.write(f'{current_time},#genre#\n') f.write(f'{current_time}更新,#genre#\n')
f.write(f'虚情的爱,https://vd2.bdstatic.com/mda-mi1dd05gmhwejdwn/sc/cae_h264/1630576203346678103/mda-mi1dd05gmhwejdwn.mp4\n') f.write(f'虚情的爱,https://vd2.bdstatic.com/mda-mi1dd05gmhwejdwn/sc/cae_h264/1630576203346678103/mda-mi1dd05gmhwejdwn.mp4\n')