aboutsummaryrefslogtreecommitdiffstats
path: root/youtube/account_functions.py
diff options
context:
space:
mode:
authorJames Taylor <user234683@users.noreply.github.com>2018-11-10 00:27:43 -0800
committerJames Taylor <user234683@users.noreply.github.com>2018-11-10 00:27:43 -0800
commit717bf210937c757595624348db9389969be9654f (patch)
tree7814a81f5c0de1084ab46f3a88b6186798932dfa /youtube/account_functions.py
parent9dd8308cf23de69c741f0304ace102718b844e16 (diff)
downloadyt-local-717bf210937c757595624348db9389969be9654f.tar.lz
yt-local-717bf210937c757595624348db9389969be9654f.tar.xz
yt-local-717bf210937c757595624348db9389969be9654f.zip
Can now store settings&data in ~/.youtube-local, keeping program files separate
Diffstat (limited to 'youtube/account_functions.py')
-rw-r--r--youtube/account_functions.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/youtube/account_functions.py b/youtube/account_functions.py
index f34e5f2..0c7973b 100644
--- a/youtube/account_functions.py
+++ b/youtube/account_functions.py
@@ -5,6 +5,8 @@ import json
from youtube import common, proto, comments
import re
import traceback
+import settings
+import os
def _post_comment(text, video_id, session_token, cookie):
headers = {
@@ -103,7 +105,7 @@ def delete_comment(video_id, comment_id, author_id, session_token, cookie):
xsrf_token_regex = re.compile(r'''XSRF_TOKEN"\s*:\s*"([\w-]*(?:=|%3D){0,2})"''')
def post_comment(query_string, fields):
- with open('data/cookie.txt', 'r', encoding='utf-8') as f:
+ with open(os.path.join(settings.data_dir, 'cookie.txt'), 'r', encoding='utf-8') as f:
cookie_data = f.read()
parameters = urllib.parse.parse_qs(query_string)