Compare commits
2 Commits
b877912d05
...
07e55d76e8
Author | SHA1 | Date | |
---|---|---|---|
07e55d76e8 | |||
c98c704b16 |
@ -167,6 +167,9 @@ class InstagramRepostJob extends BrowserJob implements ShouldBeUniqueUntilProces
|
|||||||
]));
|
]));
|
||||||
|
|
||||||
// Download the reels
|
// Download the reels
|
||||||
|
/**
|
||||||
|
* @var mixed[]
|
||||||
|
*/
|
||||||
$downloadedReels = [];
|
$downloadedReels = [];
|
||||||
foreach ($toDownloadReels as $repost) {
|
foreach ($toDownloadReels as $repost) {
|
||||||
$downloadedReels[] = [
|
$downloadedReels[] = [
|
||||||
@ -189,8 +192,11 @@ class InstagramRepostJob extends BrowserJob implements ShouldBeUniqueUntilProces
|
|||||||
$reel = $infos[0];
|
$reel = $infos[0];
|
||||||
$videoInfo = $infos[1];
|
$videoInfo = $infos[1];
|
||||||
|
|
||||||
// TODO : Avoid getting the reel from the db again, store it in the downloadedReels array
|
$repostSuccess = false;
|
||||||
$repostedReelsCounter += $this->repostReel($browser, InstagramRepost::where('reel_id', $reel->reel_id)->first(), $videoInfo);
|
do {
|
||||||
|
$repostSuccess = $this->repostReel($browser, $reel, $videoInfo);
|
||||||
|
} while (!$repostSuccess && $reel->repost_tries < self::MAX_REPOST_TRIES);
|
||||||
|
$repostedReelsCounter += $repostSuccess;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->jobRun->addArtifact(new JobArtifact([
|
$this->jobRun->addArtifact(new JobArtifact([
|
||||||
@ -336,7 +342,9 @@ class InstagramRepostJob extends BrowserJob implements ShouldBeUniqueUntilProces
|
|||||||
|
|
||||||
sleep(2); // Wait for the caption to be added
|
sleep(2); // Wait for the caption to be added
|
||||||
|
|
||||||
$this->clickNext($browser); // Share the post
|
if (config("app.environment") !== "local") { // Don't share the post in local environment
|
||||||
|
$this->clickNext($browser); // Share the post
|
||||||
|
}
|
||||||
|
|
||||||
sleep(5); // Wait for the post to be completed
|
sleep(5); // Wait for the post to be completed
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user