-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Saptarshi Sarkar <[email protected]>
- Loading branch information
1 parent
92e95c6
commit 216f0c0
Showing
12 changed files
with
87 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
out/production/Drifty/DefaultDownloadFolderLocationFinder$StreamReader.class
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
out/production/Drifty/DefaultDownloadFolderLocationFinder.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import java.io.FileOutputStream; | ||
import java.io.File; | ||
import java.io.IOException; | ||
import java.io.InputStream; | ||
import java.io.OutputStream; | ||
|
||
public class copyYt_dlp { | ||
public static final String tempDir = System.getProperty("java.io.tmpdir"); | ||
public void copyToTemp() throws IOException{ | ||
File file = new File(tempDir + "yt-dlp.exe"); | ||
if (file.exists()){ | ||
Drifty_CLI.logger.log("INFO", "Skipping copying yt-dlp to " + tempDir + " folder as it is already present!"); | ||
return; | ||
} | ||
InputStream is = getClass().getResource("yt-dlp.exe").openStream(); | ||
// sets the output stream to a system folder | ||
OutputStream os = new FileOutputStream(System.getProperty("java.io.tmpdir") + "yt-dlp.exe"); | ||
byte[] b = new byte[2048]; // length of the byte array doesn't matter in copying the file to the temp folder! | ||
int length; | ||
while ((length = is.read(b)) != -1) { | ||
os.write(b, 0, length); | ||
} | ||
is.close(); | ||
os.close(); | ||
} | ||
} |