diff --git a/jandan_toot.py b/jandan_toot.py index bd000c2..c081d41 100644 --- a/jandan_toot.py +++ b/jandan_toot.py @@ -33,13 +33,13 @@ def ramdom_ua(): def load_id(): id_list = [] - with open('/home/captain/dev/id_list') as f: + with open('/home/captain/dev/tmp/id_list') as f: id_list = f.read().splitlines() f.close() return id_list def save_id(id_list): - with open('/home/captain/dev/id_list', 'wb') as f: + with open('/home/captain/dev/tmp/id_list', 'wb') as f: for item in id_list: f.write(("%s\n" % item).encode()) f.close() diff --git a/setu_toot.py b/setu_toot.py index 9ef02a1..0a2ebc8 100644 --- a/setu_toot.py +++ b/setu_toot.py @@ -29,13 +29,13 @@ tvdl_url = 'https://tvdl-api.saif.dev/' def load_id(): id_ = None - with open('/home/captain/dev/setu_dm') as f: + with open('/home/captain/dev/tmp/setu_dm') as f: id_ = f.read() f.close() return id_ def save_id(id_): - with open('/home/captain/dev/setu_dm', 'wb') as f: + with open('/home/captain/dev/tmp/setu_dm', 'wb') as f: f.write(("%s\n" % id_).encode()) f.close() @@ -80,11 +80,11 @@ def post_mentions(): mime_type = 'image/gif' toot_resp = mastodon.media_post(r.content, mime_type) else: - f = open('/home/captain/dev/temp_download_file.%s' % ext, 'wb') + f = open('/home/captain/dev/tmp/temp_download_file.%s' % ext, 'wb') f.write(r.content) f.close() mime_type = None - toot_resp = mastodon.media_post('/home/captain/dev/temp_download_file.%s' % ext, mime_type) + toot_resp = mastodon.media_post('/home/captain/dev/tmp/temp_download_file.%s' % ext, mime_type) except: continue if toot_resp.get('id'): @@ -101,18 +101,18 @@ def post_mentions(): resp = requests.get(media['url']) if resp.status_code != 200: continue - f = open('/home/captain/dev/temp_video.mp4', 'wb') + f = open('/home/captain/dev/tmp/temp_video.mp4', 'wb') f.write(resp.content) f.close() mime_type = None try: - toot_resp = mastodon.media_post('/home/captain/dev/temp_video.mp4', mime_type) + toot_resp = mastodon.media_post('/home/captain/dev/tmp/temp_video.mp4', mime_type) except: try: - clip = VideoFileClip('/home/captain/dev/temp_video.mp4') - clip.write_gif('/home/captain/dev/temp_gif.gif') + clip = VideoFileClip('/home/captain/dev/tmp/temp_video.mp4') + clip.write_gif('/home/captain/dev/tmp/temp_gif.gif') mime_type = 'image/gif' - toot_resp = mastodon.media_post('/home/captain/dev/temp_gif.gif', mime_type) + toot_resp = mastodon.media_post('/home/captain/dev/tmp/temp_gif.gif', mime_type) except: continue if toot_resp.get('id'):