Open thailr opened 5 years ago
https://github.com/search?utf8=✓&q=MGET%2Ftimeline.py++%23+-*-+coding%3A+utf-8+-*-+from+datetime+import+datetime+from+.channel+import+Channel++import+json%2C+time%2C+base64++def+loggedIn%28func%29%3A+++++def+checkLogin%28*args%2C+**kwargs%29%3A+++++++++if+args%5B0%5D.isLogin%3A+++++++++++++return+func%28*args%2C+**kwargs%29+++++++++else%3A+++++++++++++args%5B0%5D.callback.other%28%27You+want+to+call+the+function%2C+you+must+login+to+LINE%27%29+++++return+checkLogin++++++class+Timeline%28Channel%29%3A++++++def+__init__%28self%29%3A+++++++++Channel.__init__%28self%2C+self.channel%2C+self.server.CHANNEL_ID%5B%27LINE_TIMELINE%27%5D%2C+False%29+++++++++self.tl+%3D+self.getChannelResult%28%29+++++++++self.__loginTimeline%28%29++++++++++++++def+__loginTimeline%28self%29%3A+++++++++self.server.setTimelineHeadersWithDict%28%7B+++++++++++++%27Content-Type%27%3A+%27application%2Fjson%27%2C+++++++++++++%27User-Agent%27%3A+self.server.USER_AGENT%2C+++++++++++++%27X-Line-Mid%27%3A+self.profile.mid%2C+++++++++++++%27X-Line-Carrier%27%3A+self.server.CARRIER%2C+++++++++++++%27X-Line-Application%27%3A+self.server.APP_NAME%2C+++++++++++++%27X-Line-ChannelToken%27%3A+self.tl.channelAccessToken+++++++++%7D%29+++++++++self.profileDetail+%3D+self.getProfileDetail%28%29++++++"""Timeline"""++++++%40loggedIn+++++def+getFeed%28self%2C+postLimit%3D10%2C+commentLimit%3D1%2C+likeLimit%3D1%2C+order%3D%27TIME%27%29%3A+++++++++params+%3D+%7B%27postLimit%27%3A+postLimit%2C+%27commentLimit%27%3A+commentLimit%2C+%27likeLimit%27%3A+likeLimit%2C+%27order%27%3A+order%7D+++++++++url+%3D+self.server.urlEncode%28self.server.LINE_TIMELINE_API%2C+%27%2Fv39%2Ffeed%2Flist.json%27%2C+params%29+++++++++r+%3D+self.server.getContent%28url%2C+headers%3Dself.server.timelineHeaders%29+++++++++return+r.json%28%29++++++%40loggedIn+++++def+getHomeProfile%28self%2C+mid%3DNone%2C+postLimit%3D10%2C+commentLimit%3D1%2C+likeLimit%3D1%29%3A+++++++++if+mid+is+None%3A+++++++++++++mid+%3D+self.profile.mid+++++++++params+%3D+%7B%27homeId%27%3A+mid%2C+%27postLimit%27%3A+postLimit%2C+%27commentLimit%27%3A+commentLimit%2C+%27likeLimit%27%3A+likeLimit%2C+%27sourceType%27%3A+%27LINE_PROFILE_COVER%27%7D+++++++++url+%3D+self.server.urlEncode%28self.server.LINE_TIMELINE_API%2C+%27%2Fv39%2Fpost%2Flist.json%27%2C+params%29+++++++++r+%3D+self.server.getContent%28url%2C+headers%3Dself.server.timelineHeaders%29+++++++++return+r.json%28%29++++++%40loggedIn+++++def+getProfileDetail%28self%2C+mid%3DNone%29%3A+++++++++if+mid+is+None%3A+++++++++++++mid+%3D+self.profile.mid+++++++++params+%3D+%7B%27userMid%27%3A+mid%7D+++++++++url+%3D+self.server.urlEncode%28self.server.LINE_TIMELINE_API%2C+%27%2Fv1%2Fuserpopup%2FgetDetail.json%27%2C+params%29+++++++++r+%3D+self.server.getContent%28url%2C+headers%3Dself.server.timelineHeaders%29+++++++++return+r.json%28%29++++++%40loggedIn+++++def+updateProfileCoverById%28self%2C+objId%29%3A+++++++++params+%3D+%7B%27coverImageId%27%3A+objId%7D+++++++++url+%3D+self.server.urlEncode%28self.server.LINE_TIMELINE_API%2C+%27%2Fv39%2Fhome%2FupdateCover.json%27%2C+params%29+++++++++r+%3D+self.server.getContent%28url%2C+headers%3Dself.server.timelineHeaders%29+++++++++return+r.json%28%29++++++%40loggedIn+++++def+getProfileCoverId%28self%2C+mid%3DNone%29%3A+++++++++if+mid+is+None%3A+++++++++++++mid+%3D+self.profile.mid+++++++++home+%3D+self.getProfileDetail%28mid%29+++++++++return+home%5B%27result%27%5D%5B%27objectId%27%5D++++++%40loggedIn+++++def+getProfileCoverURL%28self%2C+mid%3DNone%29%3A+++++++++if+mid+is+None%3A+++++++++++++mid+%3D+self.profile.mid+++++++++home+%3D+self.getProfileDetail%28mid%29+++++++++params+%3D+%7B%27userid%27%3A+mid%2C+%27oid%27%3A+home%5B%27result%27%5D%5B%27objectId%27%5D%7D+++++++++return+self.server.urlEncode%28self.server.LINE_OBS_DOMAIN%2C+%27%2Fmyhome%2Fc%2Fdownload.nhn%27%2C+params%29++++++"""Post"""++++++%40loggedIn+++++def+createPost%28self%2C+text%2C+holdingTime%3DNone%29%3A+++++++++params+%3D+%7B%27homeId%27%3A+self.profile.mid%2C+%27sourceType%27%3A+%27TIMELINE%27%7D+++++++++url+%3D+self.server.urlEncode%28self.server.LINE_TIMELINE_API%2C+%27%2Fv39%2Fpost%2Fcreate.json%27%2C+params%29+++++++++payload+%3D+%7B%27postInfo%27%3A+%7B%27readPermission%27%3A+%7B%27type%27%3A+%27ALL%27%7D%7D%2C+%27sourceType%27%3A+%27TIMELINE%27%2C+%27contents%27%3A+%7B%27text%27%3A+text%7D%7D+++++++++if+holdingTime+%21%3D+None%3A+++++++++++++payload%5B"postInfo"%5D%5B"holdingTime"%5D+%3D+holdingTime+++++++++data+%3D+json.dumps%28payload%29+++++++++r+%3D+self.server.postContent%28url%2C+data%3Ddata%2C+headers%3Dself.server.timelineHeaders%29+++++++++return+r.json%28%29++++++%40loggedIn+++++def+sendPostToTalk%28self%2C+mid%2C+postId%29%3A+++++++++if+mid+is+None%3A+++++++++++++mid+%3D+self.profile.mid+++++++++params+%3D+%7B%27receiveMid%27%3A+mid%2C+%27postId%27%3A+postId%7D+++++++++url+%3D+self.server.urlEncode%28self.server.LINE_TIMELINE_API%2C+%27%2Fv39%2Fpost%2FsendPostToTalk.json%27%2C+params%29+++++++++r+%3D+self.server.getContent%28url%2C+data%3Ddata%2C+headers%3Dself.server.timelineHeaders%29+++++++++return+r.json%28%29++++++%40loggedIn+++++def+createComment%28self%2C+mid%2C+postId%2C+text%29%3A+++++++++if+mid+is+None%3A+++++++++++++mid+%3D+self.profile.mid+++++++++params+%3D+%7B%27homeId%27%3A+mid%2C+%27sourceType%27%3A+%27TIMELINE%27%7D+++++++++url+%3D+self.server.urlEncode%28self.server.LINE_TIMELINE_API%2C+%27%2Fv39%2Fcomment%2Fcreate.json%27%2C+params%29+++++++++data+%3D+%7B%27commentText%27%3A+text%2C+%27activityExternalId%27%3A+postId%2C+%27actorId%27%3A+mid%7D+++++++++r+%3D+self.server.postContent%28url%2C+data%3Ddata%2C+headers%3Dself.server.timelineHeaders%29+++++++++return+r.json%28%29++++++%40loggedIn+++++def+deleteComment%28self%2C+mid%2C+postId%2C+commentId%29%3A+++++++++if+mid+is+None%3A+++++++++++++mid+%3D+self.profile.mid+++++++++params+%3D+%7B%27homeId%27%3A+mid%2C+%27sourceType%27%3A+%27TIMELINE%27%7D+++++++++url+%3D+self.server.urlEncode%28self.server.LINE_TIMELINE_API%2C+%27%2Fv39%2Fcomment%2Fdelete.json%27%2C+params%29+++++++++data+%3D+%7B%27commentId%27%3A+commentId%2C+%27activityExternalId%27%3A+postId%2C+%27actorId%27%3A+mid%7D+++++++++r+%3D+self.server.postContent%28url%2C+data%3Ddata%2C+headers%3Dself.server.timelineHeaders%29+++++++++return+r.json%28%29++++++%40loggedIn+++++def+likePost%28self%2C+mid%2C+postId%2C+likeType%3D1001%29%3A+++++++++if+mid+is+None%3A+++++++++++++mid+%3D+self.profile.mid+++++++++if+likeType+not+in+%5B1001%2C1002%2C1003%2C1004%2C1005%2C1006%5D%3A+++++++++++++raise+Exception%28%27Invalid+parameter+likeType%27%29+++++++++params+%3D+%7B%27homeId%27%3A+mid%2C+%27sourceType%27%3A+%27TIMELINE%27%7D+++++++++url+%3D+self.server.urlEncode%28self.server.LINE_TIMELINE_API%2C+%27%2Fv39%2Flike%2Fcreate.json%27%2C+params%29+++++++++data+%3D+%7B%27likeType%27%3A+likeType%2C+%27activityExternalId%27%3A+postId%2C+%27actorId%27%3A+mid%7D+++++++++r+%3D+self.server.postContent%28url%2C+data%3Ddata%2C+headers%3Dself.server.timelineHeaders%29+++++++++return+r.json%28%29++++++%40loggedIn+++++def+unlikePost%28self%2C+mid%2C+postId%29%3A+++++++++if+mid+is+None%3A+++++++++++++mid+%3D+self.profile.mid+++++++++params+%3D+%7B%27homeId%27%3A+mid%2C+%27sourceType%27%3A+%27TIMELINE%27%7D+++++++++url+%3D+self.server.urlEncode%28self.server.LINE_TIMELINE_API%2C+%27%2Fv39%2Flike%2Fcancel.json%27%2C+params%29+++++++++data+%3D+%7B%27activityExternalId%27%3A+postId%2C+%27actorId%27%3A+mid%7D+++++++++r+%3D+self.server.postContent%28url%2C+data%3Ddata%2C+headers%3Dself.server.timelineHeaders%29+++++++++return+r.json%28%29++++++"""Group+Post"""++++++%40loggedIn+++++def+createGroupPost%28self%2C+mid%2C+text%29%3A+++++++++payload+%3D+%7B%27postInfo%27%3A+%7B%27readPermission%27%3A+%7B%27homeId%27%3A+mid%7D%7D%2C+%27sourceType%27%3A+%27TIMELINE%27%2C+%27contents%27%3A+%7B%27text%27%3A+text%7D%7D+++++++++data+%3D+json.dumps%28payload%29+++++++++r+%3D+self.server.postContent%28self.server.LINE_TIMELINE_API+%2B+%27%2Fv39%2Fpost%2Fcreate.json%27%2C+data%3Ddata%2C+headers%3Dself.server.timelineHeaders%29+++++++++return+r.json%28%29++++++%40loggedIn+++++def+createGroupAlbum%28self%2C+mid%2C+name%29%3A+++++++++data+%3D+json.dumps%28%7B%27title%27%3A+name%2C+%27type%27%3A+%27image%27%7D%29+++++++++params+%3D+%7B%27homeId%27%3A+mid%2C%27count%27%3A+%271%27%2C%27auto%27%3A+%270%27%7D+++++++++url+%3D+self.server.urlEncode%28self.server.LINE_TIMELINE_MH%2C+%27%2Falbum%2Fv3%2Falbum.json%27%2C+params%29+++++++++r+%3D+self.server.postContent%28url%2C+data%3Ddata%2C+headers%3Dself.server.timelineHeaders%29+++++++++if+r.status_code+%21%3D+201%3A+++++++++++++raise+Exception%28%27Create+a+new+album+failure.%27%29+++++++++return+True++++++%40loggedIn+++++def+deleteGroupAlbum%28self%2C+mid%2C+albumId%29%3A+++++++++params+%3D+%7B%27homeId%27%3A+mid%7D+++++++++url+%3D+self.server.urlEncode%28self.server.LINE_TIMELINE_MH%2C+%27%2Falbum%2Fv3%2Falbum%2F%25s%27+%25+albumId%2C+params%29+++++++++r+%3D+self.server.deleteContent%28url%2C+headers%3Dself.server.timelineHeaders%29+++++++++if+r.status_code+%21%3D+201%3A+++++++++++++raise+Exception%28%27Delete+album+failure.%27%29+++++++++return+True++++++++++%40loggedIn+++++def+getGroupPost%28self%2C+mid%2C+postLimit%3D10%2C+commentLimit%3D1%2C+likeLimit%3D1%29%3A+++++++++params+%3D+%7B%27homeId%27%3A+mid%2C+%27commentLimit%27%3A+commentLimit%2C+%27likeLimit%27%3A+likeLimit%2C+%27sourceType%27%3A+%27TALKROOM%27%7D+++++++++url+%3D+self.server.urlEncode%28self.server.LINE_TIMELINE_API%2C+%27%2Fv39%2Fpost%2Flist.json%27%2C+params%29+++++++++r+%3D+self.server.getContent%28url%2C+headers%3Dself.server.timelineHeaders%29+++++++++return+r.json%28%29++++++"""Group+Album"""++++++%40loggedIn+++++def+getGroupAlbum%28self%2C+mid%29%3A+++++++++params+%3D+%7B%27homeId%27%3A+mid%2C+%27type%27%3A+%27g%27%2C+%27sourceType%27%3A+%27TALKROOM%27%7D+++++++++url+%3D+self.server.urlEncode%28self.server.LINE_TIMELINE_MH%2C+%27%2Falbum%2Fv3%2Falbums.json%27%2C+params%29+++++++++r+%3D+self.server.getContent%28url%2C+headers%3Dself.server.timelineHeaders%29+++++++++return+r.json%28%29++++++%40loggedIn+++++def+changeGroupAlbumName%28self%2C+mid%2C+albumId%2C+name%29%3A+++++++++data+%3D+json.dumps%28%7B%27title%27%3A+name%7D%29+++++++++params+%3D+%7B%27homeId%27%3A+mid%7D+++++++++url+%3D+self.server.urlEncode%28self.server.LINE_TIMELINE_MH%2C+%27%2Falbum%2Fv3%2Falbum%2F%25s%27+%25+albumId%2C+params%29+++++++++r+%3D+self.server.putContent%28url%2C+data%3Ddata%2C+headers%3Dself.server.timelineHeaders%29+++++++++if+r.status_code+%21%3D+201%3A+++++++++++++raise+Exception%28%27Change+album+name+failure.%27%29+++++++++return+True++++++%40loggedIn+++++def+addImageToAlbum%28self%2C+mid%2C+albumId%2C+path%29%3A+++++++++file+%3D+open%28path%2C+%27rb%27%29.read%28%29+++++++++params+%3D+%7B+++++++++++++%27oid%27%3A+int%28time.time%28%29%29%2C+++++++++++++%27quality%27%3A+%2790%27%2C+++++++++++++%27range%27%3A+len%28file%29%2C+++++++++++++%27type%27%3A+%27image%27+++++++++%7D+++++++++hr+%3D+self.server.additionalHeaders%28self.server.timelineHeaders%2C+%7B+++++++++++++%27Content-Type%27%3A+%27image%2Fjpeg%27%2C+++++++++++++%27X-Line-Mid%27%3A+mid%2C+++++++++++++%27X-Line-Album%27%3A+albumId%2C+++++++++++++%27x-obs-params%27%3A+self.genOBSParams%28params%2C%27b64%27%29+++++++++%7D%29+++++++++r+%3D+self.server.getContent%28self.server.LINE_OBS_DOMAIN+%2B+%27%2Falbum%2Fa%2Fupload.nhn%27%2C+data%3Dfile%2C+headers%3Dhr%29+++++++++if+r.status_code+%21%3D+201%3A+++++++++++++raise+Exception%28%27Add+image+to+album+failure.%27%29+++++++++return+r.json%28%29++++++%40loggedIn+++++def+getImageGroupAlbum%28self%2C+mid%2C+albumId%2C+objId%2C+returnAs%3D%27path%27%2C+saveAs%3D%27%27%29%3A+++++++++if+saveAs+%3D%3D+%27%27%3A+++++++++++++saveAs+%3D+self.genTempFile%28%27path%27%29+++++++++if+returnAs+not+in+%5B%27path%27%2C%27bool%27%2C%27bin%27%5D%3A+++++++++++++raise+Exception%28%27Invalid+returnAs+value%27%29+++++++++hr+%3D+self.server.additionalHeaders%28self.server.timelineHeaders%2C+%7B+++++++++++++%27Content-Type%27%3A+%27image%2Fjpeg%27%2C+++++++++++++%27X-Line-Mid%27%3A+mid%2C+++++++++++++%27X-Line-Album%27%3A+albumId+++++++++%7D%29+++++++++params+%3D+%7B%27ver%27%3A+%271.0%27%2C+%27oid%27%3A+objId%7D+++++++++url+%3D+self.server.urlEncode%28self.server.LINE_OBS_DOMAIN%2C+%27%2Falbum%2Fa%2Fdownload.nhn%27%2C+params%29+++++++++r+%3D+self.server.getContent%28url%2C+headers%3Dhr%29+++++++++if+r.status_code+%3D%3D+200%3A+++++++++++++self.saveFile%28saveAs%2C+r.raw%29+++++++++++++if+returnAs+%3D%3D+%27path%27%3A+++++++++++++++++return+saveAs+++++++++++++elif+returnAs+%3D%3D+%27bool%27%3A+++++++++++++++++return+True+++++++++++++elif+returnAs+%3D%3D+%27bin%27%3A+++++++++++++++++return+r.raw+++++++++else%3A+++++++++++++raise+Exception%28%27Download+image+album+failure.%27%29++Desktop+version+Sign+out&type=
https://github.com/search?utf8=✓&q=MGET%2Ftimeline.py++%23+-*-+coding%3A+utf-8+-*-+from+datetime+import+datetime+from+.channel+import+Channel++import+json%2C+time%2C+base64++def+loggedIn%28func%29%3A+++++def+checkLogin%28*args%2C+**kwargs%29%3A+++++++++if+args%5B0%5D.isLogin%3A+++++++++++++return+func%28*args%2C+**kwargs%29+++++++++else%3A+++++++++++++args%5B0%5D.callback.other%28%27You+want+to+call+the+function%2C+you+must+login+to+LINE%27%29+++++return+checkLogin++++++class+Timeline%28Channel%29%3A++++++def+__init__%28self%29%3A+++++++++Channel.__init__%28self%2C+self.channel%2C+self.server.CHANNEL_ID%5B%27LINE_TIMELINE%27%5D%2C+False%29+++++++++self.tl+%3D+self.getChannelResult%28%29+++++++++self.__loginTimeline%28%29++++++++++++++def+__loginTimeline%28self%29%3A+++++++++self.server.setTimelineHeadersWithDict%28%7B+++++++++++++%27Content-Type%27%3A+%27application%2Fjson%27%2C+++++++++++++%27User-Agent%27%3A+self.server.USER_AGENT%2C+++++++++++++%27X-Line-Mid%27%3A+self.profile.mid%2C+++++++++++++%27X-Line-Carrier%27%3A+self.server.CARRIER%2C+++++++++++++%27X-Line-Application%27%3A+self.server.APP_NAME%2C+++++++++++++%27X-Line-ChannelToken%27%3A+self.tl.channelAccessToken+++++++++%7D%29+++++++++self.profileDetail+%3D+self.getProfileDetail%28%29++++++"""Timeline"""++++++%40loggedIn+++++def+getFeed%28self%2C+postLimit%3D10%2C+commentLimit%3D1%2C+likeLimit%3D1%2C+order%3D%27TIME%27%29%3A+++++++++params+%3D+%7B%27postLimit%27%3A+postLimit%2C+%27commentLimit%27%3A+commentLimit%2C+%27likeLimit%27%3A+likeLimit%2C+%27order%27%3A+order%7D+++++++++url+%3D+self.server.urlEncode%28self.server.LINE_TIMELINE_API%2C+%27%2Fv39%2Ffeed%2Flist.json%27%2C+params%29+++++++++r+%3D+self.server.getContent%28url%2C+headers%3Dself.server.timelineHeaders%29+++++++++return+r.json%28%29++++++%40loggedIn+++++def+getHomeProfile%28self%2C+mid%3DNone%2C+postLimit%3D10%2C+commentLimit%3D1%2C+likeLimit%3D1%29%3A+++++++++if+mid+is+None%3A+++++++++++++mid+%3D+self.profile.mid+++++++++params+%3D+%7B%27homeId%27%3A+mid%2C+%27postLimit%27%3A+postLimit%2C+%27commentLimit%27%3A+commentLimit%2C+%27likeLimit%27%3A+likeLimit%2C+%27sourceType%27%3A+%27LINE_PROFILE_COVER%27%7D+++++++++url+%3D+self.server.urlEncode%28self.server.LINE_TIMELINE_API%2C+%27%2Fv39%2Fpost%2Flist.json%27%2C+params%29+++++++++r+%3D+self.server.getContent%28url%2C+headers%3Dself.server.timelineHeaders%29+++++++++return+r.json%28%29++++++%40loggedIn+++++def+getProfileDetail%28self%2C+mid%3DNone%29%3A+++++++++if+mid+is+None%3A+++++++++++++mid+%3D+self.profile.mid+++++++++params+%3D+%7B%27userMid%27%3A+mid%7D+++++++++url+%3D+self.server.urlEncode%28self.server.LINE_TIMELINE_API%2C+%27%2Fv1%2Fuserpopup%2FgetDetail.json%27%2C+params%29+++++++++r+%3D+self.server.getContent%28url%2C+headers%3Dself.server.timelineHeaders%29+++++++++return+r.json%28%29++++++%40loggedIn+++++def+updateProfileCoverById%28self%2C+objId%29%3A+++++++++params+%3D+%7B%27coverImageId%27%3A+objId%7D+++++++++url+%3D+self.server.urlEncode%28self.server.LINE_TIMELINE_API%2C+%27%2Fv39%2Fhome%2FupdateCover.json%27%2C+params%29+++++++++r+%3D+self.server.getContent%28url%2C+headers%3Dself.server.timelineHeaders%29+++++++++return+r.json%28%29++++++%40loggedIn+++++def+getProfileCoverId%28self%2C+mid%3DNone%29%3A+++++++++if+mid+is+None%3A+++++++++++++mid+%3D+self.profile.mid+++++++++home+%3D+self.getProfileDetail%28mid%29+++++++++return+home%5B%27result%27%5D%5B%27objectId%27%5D++++++%40loggedIn+++++def+getProfileCoverURL%28self%2C+mid%3DNone%29%3A+++++++++if+mid+is+None%3A+++++++++++++mid+%3D+self.profile.mid+++++++++home+%3D+self.getProfileDetail%28mid%29+++++++++params+%3D+%7B%27userid%27%3A+mid%2C+%27oid%27%3A+home%5B%27result%27%5D%5B%27objectId%27%5D%7D+++++++++return+self.server.urlEncode%28self.server.LINE_OBS_DOMAIN%2C+%27%2Fmyhome%2Fc%2Fdownload.nhn%27%2C+params%29++++++"""Post"""++++++%40loggedIn+++++def+createPost%28self%2C+text%2C+holdingTime%3DNone%29%3A+++++++++params+%3D+%7B%27homeId%27%3A+self.profile.mid%2C+%27sourceType%27%3A+%27TIMELINE%27%7D+++++++++url+%3D+self.server.urlEncode%28self.server.LINE_TIMELINE_API%2C+%27%2Fv39%2Fpost%2Fcreate.json%27%2C+params%29+++++++++payload+%3D+%7B%27postInfo%27%3A+%7B%27readPermission%27%3A+%7B%27type%27%3A+%27ALL%27%7D%7D%2C+%27sourceType%27%3A+%27TIMELINE%27%2C+%27contents%27%3A+%7B%27text%27%3A+text%7D%7D+++++++++if+holdingTime+%21%3D+None%3A+++++++++++++payload%5B"postInfo"%5D%5B"holdingTime"%5D+%3D+holdingTime+++++++++data+%3D+json.dumps%28payload%29+++++++++r+%3D+self.server.postContent%28url%2C+data%3Ddata%2C+headers%3Dself.server.timelineHeaders%29+++++++++return+r.json%28%29++++++%40loggedIn+++++def+sendPostToTalk%28self%2C+mid%2C+postId%29%3A+++++++++if+mid+is+None%3A+++++++++++++mid+%3D+self.profile.mid+++++++++params+%3D+%7B%27receiveMid%27%3A+mid%2C+%27postId%27%3A+postId%7D+++++++++url+%3D+self.server.urlEncode%28self.server.LINE_TIMELINE_API%2C+%27%2Fv39%2Fpost%2FsendPostToTalk.json%27%2C+params%29+++++++++r+%3D+self.server.getContent%28url%2C+data%3Ddata%2C+headers%3Dself.server.timelineHeaders%29+++++++++return+r.json%28%29++++++%40loggedIn+++++def+createComment%28self%2C+mid%2C+postId%2C+text%29%3A+++++++++if+mid+is+None%3A+++++++++++++mid+%3D+self.profile.mid+++++++++params+%3D+%7B%27homeId%27%3A+mid%2C+%27sourceType%27%3A+%27TIMELINE%27%7D+++++++++url+%3D+self.server.urlEncode%28self.server.LINE_TIMELINE_API%2C+%27%2Fv39%2Fcomment%2Fcreate.json%27%2C+params%29+++++++++data+%3D+%7B%27commentText%27%3A+text%2C+%27activityExternalId%27%3A+postId%2C+%27actorId%27%3A+mid%7D+++++++++r+%3D+self.server.postContent%28url%2C+data%3Ddata%2C+headers%3Dself.server.timelineHeaders%29+++++++++return+r.json%28%29++++++%40loggedIn+++++def+deleteComment%28self%2C+mid%2C+postId%2C+commentId%29%3A+++++++++if+mid+is+None%3A+++++++++++++mid+%3D+self.profile.mid+++++++++params+%3D+%7B%27homeId%27%3A+mid%2C+%27sourceType%27%3A+%27TIMELINE%27%7D+++++++++url+%3D+self.server.urlEncode%28self.server.LINE_TIMELINE_API%2C+%27%2Fv39%2Fcomment%2Fdelete.json%27%2C+params%29+++++++++data+%3D+%7B%27commentId%27%3A+commentId%2C+%27activityExternalId%27%3A+postId%2C+%27actorId%27%3A+mid%7D+++++++++r+%3D+self.server.postContent%28url%2C+data%3Ddata%2C+headers%3Dself.server.timelineHeaders%29+++++++++return+r.json%28%29++++++%40loggedIn+++++def+likePost%28self%2C+mid%2C+postId%2C+likeType%3D1001%29%3A+++++++++if+mid+is+None%3A+++++++++++++mid+%3D+self.profile.mid+++++++++if+likeType+not+in+%5B1001%2C1002%2C1003%2C1004%2C1005%2C1006%5D%3A+++++++++++++raise+Exception%28%27Invalid+parameter+likeType%27%29+++++++++params+%3D+%7B%27homeId%27%3A+mid%2C+%27sourceType%27%3A+%27TIMELINE%27%7D+++++++++url+%3D+self.server.urlEncode%28self.server.LINE_TIMELINE_API%2C+%27%2Fv39%2Flike%2Fcreate.json%27%2C+params%29+++++++++data+%3D+%7B%27likeType%27%3A+likeType%2C+%27activityExternalId%27%3A+postId%2C+%27actorId%27%3A+mid%7D+++++++++r+%3D+self.server.postContent%28url%2C+data%3Ddata%2C+headers%3Dself.server.timelineHeaders%29+++++++++return+r.json%28%29++++++%40loggedIn+++++def+unlikePost%28self%2C+mid%2C+postId%29%3A+++++++++if+mid+is+None%3A+++++++++++++mid+%3D+self.profile.mid+++++++++params+%3D+%7B%27homeId%27%3A+mid%2C+%27sourceType%27%3A+%27TIMELINE%27%7D+++++++++url+%3D+self.server.urlEncode%28self.server.LINE_TIMELINE_API%2C+%27%2Fv39%2Flike%2Fcancel.json%27%2C+params%29+++++++++data+%3D+%7B%27activityExternalId%27%3A+postId%2C+%27actorId%27%3A+mid%7D+++++++++r+%3D+self.server.postContent%28url%2C+data%3Ddata%2C+headers%3Dself.server.timelineHeaders%29+++++++++return+r.json%28%29++++++"""Group+Post"""++++++%40loggedIn+++++def+createGroupPost%28self%2C+mid%2C+text%29%3A+++++++++payload+%3D+%7B%27postInfo%27%3A+%7B%27readPermission%27%3A+%7B%27homeId%27%3A+mid%7D%7D%2C+%27sourceType%27%3A+%27TIMELINE%27%2C+%27contents%27%3A+%7B%27text%27%3A+text%7D%7D+++++++++data+%3D+json.dumps%28payload%29+++++++++r+%3D+self.server.postContent%28self.server.LINE_TIMELINE_API+%2B+%27%2Fv39%2Fpost%2Fcreate.json%27%2C+data%3Ddata%2C+headers%3Dself.server.timelineHeaders%29+++++++++return+r.json%28%29++++++%40loggedIn+++++def+createGroupAlbum%28self%2C+mid%2C+name%29%3A+++++++++data+%3D+json.dumps%28%7B%27title%27%3A+name%2C+%27type%27%3A+%27image%27%7D%29+++++++++params+%3D+%7B%27homeId%27%3A+mid%2C%27count%27%3A+%271%27%2C%27auto%27%3A+%270%27%7D+++++++++url+%3D+self.server.urlEncode%28self.server.LINE_TIMELINE_MH%2C+%27%2Falbum%2Fv3%2Falbum.json%27%2C+params%29+++++++++r+%3D+self.server.postContent%28url%2C+data%3Ddata%2C+headers%3Dself.server.timelineHeaders%29+++++++++if+r.status_code+%21%3D+201%3A+++++++++++++raise+Exception%28%27Create+a+new+album+failure.%27%29+++++++++return+True++++++%40loggedIn+++++def+deleteGroupAlbum%28self%2C+mid%2C+albumId%29%3A+++++++++params+%3D+%7B%27homeId%27%3A+mid%7D+++++++++url+%3D+self.server.urlEncode%28self.server.LINE_TIMELINE_MH%2C+%27%2Falbum%2Fv3%2Falbum%2F%25s%27+%25+albumId%2C+params%29+++++++++r+%3D+self.server.deleteContent%28url%2C+headers%3Dself.server.timelineHeaders%29+++++++++if+r.status_code+%21%3D+201%3A+++++++++++++raise+Exception%28%27Delete+album+failure.%27%29+++++++++return+True++++++++++%40loggedIn+++++def+getGroupPost%28self%2C+mid%2C+postLimit%3D10%2C+commentLimit%3D1%2C+likeLimit%3D1%29%3A+++++++++params+%3D+%7B%27homeId%27%3A+mid%2C+%27commentLimit%27%3A+commentLimit%2C+%27likeLimit%27%3A+likeLimit%2C+%27sourceType%27%3A+%27TALKROOM%27%7D+++++++++url+%3D+self.server.urlEncode%28self.server.LINE_TIMELINE_API%2C+%27%2Fv39%2Fpost%2Flist.json%27%2C+params%29+++++++++r+%3D+self.server.getContent%28url%2C+headers%3Dself.server.timelineHeaders%29+++++++++return+r.json%28%29++++++"""Group+Album"""++++++%40loggedIn+++++def+getGroupAlbum%28self%2C+mid%29%3A+++++++++params+%3D+%7B%27homeId%27%3A+mid%2C+%27type%27%3A+%27g%27%2C+%27sourceType%27%3A+%27TALKROOM%27%7D+++++++++url+%3D+self.server.urlEncode%28self.server.LINE_TIMELINE_MH%2C+%27%2Falbum%2Fv3%2Falbums.json%27%2C+params%29+++++++++r+%3D+self.server.getContent%28url%2C+headers%3Dself.server.timelineHeaders%29+++++++++return+r.json%28%29++++++%40loggedIn+++++def+changeGroupAlbumName%28self%2C+mid%2C+albumId%2C+name%29%3A+++++++++data+%3D+json.dumps%28%7B%27title%27%3A+name%7D%29+++++++++params+%3D+%7B%27homeId%27%3A+mid%7D+++++++++url+%3D+self.server.urlEncode%28self.server.LINE_TIMELINE_MH%2C+%27%2Falbum%2Fv3%2Falbum%2F%25s%27+%25+albumId%2C+params%29+++++++++r+%3D+self.server.putContent%28url%2C+data%3Ddata%2C+headers%3Dself.server.timelineHeaders%29+++++++++if+r.status_code+%21%3D+201%3A+++++++++++++raise+Exception%28%27Change+album+name+failure.%27%29+++++++++return+True++++++%40loggedIn+++++def+addImageToAlbum%28self%2C+mid%2C+albumId%2C+path%29%3A+++++++++file+%3D+open%28path%2C+%27rb%27%29.read%28%29+++++++++params+%3D+%7B+++++++++++++%27oid%27%3A+int%28time.time%28%29%29%2C+++++++++++++%27quality%27%3A+%2790%27%2C+++++++++++++%27range%27%3A+len%28file%29%2C+++++++++++++%27type%27%3A+%27image%27+++++++++%7D+++++++++hr+%3D+self.server.additionalHeaders%28self.server.timelineHeaders%2C+%7B+++++++++++++%27Content-Type%27%3A+%27image%2Fjpeg%27%2C+++++++++++++%27X-Line-Mid%27%3A+mid%2C+++++++++++++%27X-Line-Album%27%3A+albumId%2C+++++++++++++%27x-obs-params%27%3A+self.genOBSParams%28params%2C%27b64%27%29+++++++++%7D%29+++++++++r+%3D+self.server.getContent%28self.server.LINE_OBS_DOMAIN+%2B+%27%2Falbum%2Fa%2Fupload.nhn%27%2C+data%3Dfile%2C+headers%3Dhr%29+++++++++if+r.status_code+%21%3D+201%3A+++++++++++++raise+Exception%28%27Add+image+to+album+failure.%27%29+++++++++return+r.json%28%29++++++%40loggedIn+++++def+getImageGroupAlbum%28self%2C+mid%2C+albumId%2C+objId%2C+returnAs%3D%27path%27%2C+saveAs%3D%27%27%29%3A+++++++++if+saveAs+%3D%3D+%27%27%3A+++++++++++++saveAs+%3D+self.genTempFile%28%27path%27%29+++++++++if+returnAs+not+in+%5B%27path%27%2C%27bool%27%2C%27bin%27%5D%3A+++++++++++++raise+Exception%28%27Invalid+returnAs+value%27%29+++++++++hr+%3D+self.server.additionalHeaders%28self.server.timelineHeaders%2C+%7B+++++++++++++%27Content-Type%27%3A+%27image%2Fjpeg%27%2C+++++++++++++%27X-Line-Mid%27%3A+mid%2C+++++++++++++%27X-Line-Album%27%3A+albumId+++++++++%7D%29+++++++++params+%3D+%7B%27ver%27%3A+%271.0%27%2C+%27oid%27%3A+objId%7D+++++++++url+%3D+self.server.urlEncode%28self.server.LINE_OBS_DOMAIN%2C+%27%2Falbum%2Fa%2Fdownload.nhn%27%2C+params%29+++++++++r+%3D+self.server.getContent%28url%2C+headers%3Dhr%29+++++++++if+r.status_code+%3D%3D+200%3A+++++++++++++self.saveFile%28saveAs%2C+r.raw%29+++++++++++++if+returnAs+%3D%3D+%27path%27%3A+++++++++++++++++return+saveAs+++++++++++++elif+returnAs+%3D%3D+%27bool%27%3A+++++++++++++++++return+True+++++++++++++elif+returnAs+%3D%3D+%27bin%27%3A+++++++++++++++++return+r.raw+++++++++else%3A+++++++++++++raise+Exception%28%27Download+image+album+failure.%27%29++Desktop+version+Sign+out&type=