@@ -237,7 +237,22 @@ def add_general_label(self, articles, label):
237237 self .session .post (url , params = params , proxies = self .proxies ),
238238 json_data = False
239239 )
240+
241+ def remove_general_label (self , articles , label ):
242+ self .check_token ()
240243
244+ url = urljoin (BASE_URL , self .EDIT_TAG_PATH )
245+ for start in range (0 , len (articles ), 10 ):
246+ end = min (start + 10 , len (articles ))
247+ params = {
248+ 'r' : label ,
249+ 'i' : [articles [idx ].id for idx in range (start , end )]
250+ }
251+ self .parse_response (
252+ self .session .post (url , params = params , proxies = self .proxies ),
253+ json_data = False
254+ )
255+
241256 def add_tag (self , articles , tag ):
242257 self .add_general_label (articles , self .GENERAL_TAG_TEMPLATE .format (tag ))
243258
@@ -250,5 +265,17 @@ def mark_as_starred(self, articles):
250265 def mark_as_liked (self , articles ):
251266 self .add_general_label (articles , self .LIKED_TAG )
252267
268+ def remove_tag (self , articles , tag ):
269+ self .remove_general_label (articles , self .GENERAL_TAG_TEMPLATE .format (tag ))
270+
271+ def remove_read (self , articles ):
272+ self .remove_general_label (articles , self .READ_TAG )
273+
274+ def remove_starred (self , articles ):
275+ self .remove_general_label (articles , self .STARRED_TAG )
276+
277+ def remove_liked (self , articles ):
278+ self .remove_general_label (articles , self .LIKED_TAG )
279+
253280 def broadcast (self , articles ):
254281 self .add_general_label (articles , self .BROADCAST_TAG )
0 commit comments