# HookDouYin **Repository Path**: vww/HookDouYin ## Basic Information - **Project Name**: HookDouYin - **Description**: iOS逆向:如何让抖音自动播放下一个视频(懒人癌) - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2023-10-20 - **Last Updated**: 2023-10-25 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # HookDouYin ## 文章参考地址:https://www.52pojie.cn/thread-865083-1-1.html 2023.10.20 更新 v20.7.0 ``` static NSString * const VideoPlayEndedNotiName = @"VideoPlayEndedNotiName"; static NSString * const OpenAutoPlay = @"OpenAutoPlay"; @interface AWEAwemeDetailTableViewController : UIViewController @property (nonatomic, assign) NSInteger currentPlayIndex; @end %hook AWEAwemeDetailTableViewController -(void)_addNotifications{ %orig; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(playNext2) name:VideoPlayEndedNotiName object:nil]; } %new -(void)playNext2{ UITableView *tableView = [self valueForKey:@"_tableView"]; NSIndexPath *path = [NSIndexPath indexPathForRow:self.currentPlayIndex +1 inSection:0]; [tableView scrollToRowAtIndexPath:path atScrollPosition:UITableViewScrollPositionMiddle animated:YES]; } %end %hook TTVideoEngineOwnPlayer -(void)playerItemDidReachEnd{ %orig; //[[NSNotificationCenter defaultCenter] postNotificationName:VideoPlayEndedNotiName object:nil]; int64_t delayInSeconds = 1.0; // 延迟的时间 /* * delta: * @parameter 1.时间参照,从此刻开始计时 * @parameter 2.延时多久,此处为秒级,还有纳秒等: 10ull * NSEC_PER_MSEC */ __weak typeof(self)weakSelf = self; dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayInSeconds * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ // [weakSelf delayMethod]; [[NSNotificationCenter defaultCenter] postNotificationName:VideoPlayEndedNotiName object:nil]; }); } %end ``` ![输入图片说明](IMG/IMG_01.PNG) ![输入图片说明](IMG/IMG_02.PNG) ![输入图片说明](IMG/IMG_03.PNG) ![输入图片说明](IMG/IMG_04.PNG) ![输入图片说明](IMG/IMG_05.PNG) ![输入图片说明](IMG/IMG_06.PNG) ![输入图片说明](IMG/IMG_07.PNG) ![输入图片说明](IMG/IMG_08.PNG) ![输入图片说明](IMG/IMG_09.PNG) ![输入图片说明](IMG/IMG_010.PNG) ![输入图片说明](IMG/IMG_011.gif) ![输入图片说明](IMG/IMG_4292.MOV)