Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
[true java call completed] https://github.com/siddht1/ydl_java help needeed , porting youtube-dl to java #10975
Comments
|
well these is the current code i have made to run it through exec command in java import java.io.*; Process p2 = Runtime.getRuntime().exec("python main.py -v"); |
It's a Jython bug, which can be work-arounded by modifying line 2604 of $ git diff youtube_dl/compat.py
diff --git a/youtube_dl/compat.py b/youtube_dl/compat.py
index b8aaf5a..b7a57d6 100644
--- a/youtube_dl/compat.py
+++ b/youtube_dl/compat.py
@@ -2601,7 +2601,7 @@ try:
isinstance(args[0], compat_str) and
args[0] == '中文')
compat_shlex_split = shlex.split
-except (AssertionError, UnicodeEncodeError):
+except:
# Working around shlex issue with unicode strings on some python 2
# versions (see http://bugs.python.org/issue1548891)
def compat_shlex_split(s, comments=False, posix=True):I suggest not to use Jython as there are too many bugs in it. Closing as it's not a youtube-dl bug. |
|
hav3 you a worki g code , if yes share pls as this project has now become a headache for me |
|
After changing line 2604, jython works for me:
Jython version:
I compile Jython from sources. IIRC the latest release (2.7.0) has quite a few bugs. |
|
The Jython bug is reported to http://bugs.jython.org/issue2527 |
|
thank you , the makeover took time to register in my mind . |
|
can you actually verify this indeed is the code , sorry to take your time rename compat.py.txt to compat.py as github doesnt allow to upload python source files yet. |
|
my jython java -jar jython.jar Jython 2.7.0 (default:9987c746f838, Apr 29 2015, 02:25:11) |
|
Seems you've deleted some innocent lines. This is my version: compat.py.txt |
|
added a working makeover |
|
@yan12125 does youtube-dl externally or internally calls ffmpeg check my code here https://github.com/siddht1/youtube_dl_java feedback from you is appreciated |
|
https://github.com/siddht1/youtube_dl_java usage then provide your url or command |
|
how -v is executed in youtube-dl my java caller doesnt seem to output it |
|
Good job!
It indeed calls ffmpeg. I'm not sure what's the difference between "externally" and "internally".
Logs are printed to STDERR |
|
well internally means does youtube-dl handles it i.e there is code to run ffmpeg directly inside youtube-dl eg and externally means it has to call ffmpeg , then youtube-dl proceeds eg |
|
I guess what youtube-dl does is more likely "externally". youtube-dl and ffmpeg run in different processes. |
|
@yan12125 can you mail me your mail id , my email id : dhar.75.ap@gmail.com |
|
You can find my mail on Github profile page, but is there anything you don't want to discuss publicly? |
|
well you are youtube-dl maintainer , so I thought there are some youtube-dl parts(codes) completely out of my mind i don`t want to put issues for them , like this is an external bug itself |
|
OK feel free to drop me mails. I'll try my best to answer you. |
|
thank you |
|
well is where i would be working @yan12125 |
|
Anything printed after adding |
|
output , you can try yourself |
|
Indeed I got nothing. By the way, Google says |
|
yes , fixing it |
|
yes got what the problem is |
|
@yan12125 how does youtube_dl suppose to call in mac, in linux its youtube-dl , in windows its youtube-dl.exe , python enviroment python _main.py , i need as i am about to release the next version by detecting os ,test module at https://github.com/siddht1/youtube_dl_java/blob/master/new_comp/OpertingSystemInfo.java |
|
On Mac is quite similar to on Linux |
|
@yan12125 what`s it , should i use linux,unix,mac as same /usr/local/bin/youtube-dl |
|
You can (nobody can say you should :) |
|
@yan12125 can you suggest any new feature , not present in original youtube_dl to be added in my project , i actually am going to use the sub fork of my projects one this time |
|
There are quite a few missing features in youtube-dl. What do you want? |
|
what can you provide , if possible. which version youtube-dl used to support instagram completly |
|
What do you mean by "completely"? Anyway this may help: https://github.com/rg3/youtube-dl/search?q=instagram&state=open&type=Issues&utf8=%E2%9C%93 |
|
completely meant for both handling image and video. can youtubr-dl download images and other format too. If yes which python script has to be modified |
|
You need to modify instagram.py. Here's a tip: #9337 (comment) |
|
@yan12125 thank you for the tip , i m a noob in programming languages so will update it ,if it works . would also add jython comptability this time |
|
The program is ready and I m now upgrading it. I have also updated the wikI , it lists all p mod of youtube-dl too. I will try to merge it here as its a wikI and will surely help a lot of devs too. I will soon implement code in java too run exactly as youtube-dl. Thats the complete rework/rewrite in java. Once commited you and others can try too. |
|
FWIW the Jython-bug mentioned here (http://bugs.jython.org/issue2527) was just fixed as of jython/frozen-mirror@0b38e39. |
|
great , the UI should now work with java , python , jython . would update jython and build the old code once more . |
|
new code should be compatible with c,c++,java,jython and python as it extends https://github.com/siddht1/youtube_dl_embed/blob/master/1.py Php is also under way |
Please follow the guide below
xinto all the boxes [ ] relevant to your issue (like that [x])Make sure you are using the latest version: run
youtube-dl --versionand ensure your version is 2016.10.19. If it's not read this FAQ entry and update. Issues with outdated version will be rejected.Before submitting an issue make sure you have:
What is the purpose of your issue?
The following sections concretize particular purposed issues, you can erase any section (the contents between triple ---) not applicable to your issue
If the purpose of this issue is a bug report, site support request or you are not completely sure provide the full verbose output as follows:
Add
-vflag to your command line you run youtube-dl with, copy the whole output and insert it here. It should look similar to one below (replace it with your log inserted between triple ```):If the purpose of this issue is a site support request please provide all kinds of example URLs support for which should be included (replace following example URLs by yours):
Description of your issue, suggested solution and other information
Explanation of your issue in arbitrary form goes here. Please make sure the description is worded well enough to be understood. Provide as much context and examples as possible.
If work on your issue requires account credentials please provide them or explain how one can obtain them.
i m currently developing a fix to run youtube-dl under java
method 1 :
java bytecode ----> jvm ----> exec python ----> python -----> youtube-dl
method 2 :
java bytecode ----> jvm ----> exec jython ----> jython -----> youtube-dl
these are the output if youtube-dl is run through jython directly via terminal
code : java -jar jython.jar main.py -v
output:
Traceback (most recent call last):
File "/home/gh/Documents/jython.jar/Lib/runpy.py", line 161, in _run_module_as_main
File "/home/gh/Documents/jython.jar/Lib/runpy.py", line 72, in _run_code
File "youtube-dl.py/main.py", line 16, in
File "youtube-dl.py/youtube_dl/init.py", line 15, in
File "youtube-dl.py/youtube_dl/options.py", line 8, in
File "youtube-dl.py/youtube_dl/downloader/init.py", line 3, in
File "youtube-dl.py/youtube_dl/downloader/common.py", line 9, in
File "youtube-dl.py/youtube_dl/compat.py", line 2599, in
File "youtube-dl.py/youtube_dl/compat.py", line 2599, in
File "/home/gh/Documents/jython.jar/Lib/shlex.py", line 279, in split
File "/home/gh/Documents/jython.jar/Lib/shlex.py", line 269, in next
File "/home/gh/Documents/jython.jar/Lib/shlex.py", line 96, in get_token
File "/home/gh/Documents/jython.jar/Lib/shlex.py", line 124, in read_token
at org.python.core.PyString.(PyString.java:64)
at org.python.core.PyString.(PyString.java:70)
at org.python.modules.cStringIO$StringIO.read(cStringIO.java:225)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: Cannot create PyString with non-byte value