API_ROOT = 'https://www.dcard.tw/_api'
FORUMS = 'forums'
POSTS = 'posts'


forums_url = '{api_root}/{api_forums}'.format(
    api_root=API_ROOT,
    api_forums=FORUMS
)

posts_meta_url_pattern = '{api_root}/{api_forums}/{{forum}}/{api_posts}'.format(
    api_root=API_ROOT,
    api_forums=FORUMS,
    api_posts=POSTS,
)

post_url_pattern = '{api_root}/{api_posts}/{{post_id}}'.format(
    api_root=API_ROOT,
    api_posts=POSTS,
)

post_links_url_pattern = '{post_url}/links'.format(
    post_url=post_url_pattern
)

post_comments_url_pattern = '{post_url}/comments'.format(
    post_url=post_url_pattern
)

@@ -1,16 +1,14 @@
-API_ROOT
+DOMAIN
  = 'http
@@ -28,426 +28,163 @@
 .tw/
-_api'%0D%0AFORUMS = 'forums'%0D%0APOSTS = 'posts'%0D%0A%0D%0A%0D%0Aforums_url = '%7Bapi_root%7D/%7Bapi_forums%7D'.format(%0D%0A    api_root=API_ROOT,%0D%0A    api_
+'%0D%0A%0D%0Aforums_url = DOMAIN + '_api/
 forums
-=FORUMS%0D%0A)%0D%0A%0D%0Aposts_meta_url_pattern = '%7Bapi_root%7D/%7Bapi_forums%7D/%7B%7Bforum%7D%7D/%7Bapi_posts%7D'.format(%0D%0A    api_root=API_ROOT,%0D%0A    api_forums=FORUMS,%0D%0A    api_posts=POSTS,%0D%0A)%0D%0A%0D%0Apost_url_pattern = '%7Bapi_root%7D/%7Bapi_posts%7D/%7B%7Bpost_id%7D%7D'.format(%0D%0A    api_root=API_ROOT,%0D%0A    api_posts=POSTS,%0D%0A)%0D%0A
+'%0D%0Apost_url_pattern = DOMAIN + '_api/posts/%7Bpost_id%7D'%0D%0Aposts_meta_url_pattern = DOMAIN + '_api/forums/%7Bforum%7D/posts'
 %0D%0Apo
@@ -210,26 +210,45 @@
 n = 
-'
+DOMAIN + '_api/posts/
 %7Bpost_
-url
+id
 %7D/links'
 .for
@@ -247,52 +247,8 @@
 nks'
-.format(%0D%0A    post_url=post_url_pattern%0D%0A)%0D%0A
 %0D%0Apo
@@ -277,18 +277,37 @@
 n = 
-'
+DOMAIN + '_api/posts/
 %7Bpost_
-url
+id
 %7D/co
@@ -317,48 +317,6 @@
 nts'
-.format(%0D%0A    post_url=post_url_pattern%0D%0A)
 %0D%0A

simplify api formats