Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't create a pull request #17599

Closed
GourangaDas opened this issue Sep 18, 2018 · 1 comment
Closed

Can't create a pull request #17599

GourangaDas opened this issue Sep 18, 2018 · 1 comment

Comments

@GourangaDas
Copy link

@GourangaDas GourangaDas commented Sep 18, 2018

Hi!
I am just newbie and can't create a pull request.
Will you guide me in details.... please...

For this reason, I am posting the matter as a issue here. Sorry for this...

Actually if I want to get output info of all formats available along with the downloadable links, I may try with '-F -g' option, but this arguments returns nothing to output window (cmd).

I am feeling uneasy to write a GUI of youtube-dl. The application uses youtube-dl to get infos and the links. End-user should have the choice to use youtube-dl or other download manager. I need to call youtube-dl twice, first for getting information and another call for getting link of the requested format as it will be requested from end-user end.

To make the matter more simple to realize, I want to say that I need a table like below:

Format Code Resolution Note Links
a........... a........ a................. a........... a...........
b........... b........ b................. b........... b...........
c........... c........ c................ c........... c........... and more .......

Actually I need to get a column of links.

But there is no provision to get it now, as far I know...
At this point, I am forced to have a look in the code of youtube-dl, have found that some changes of code may make the youtube-dl able to give this type of output and it will not consume much more time to produce.....

On Youtube-dl.py at the 'def list_formats(self, info_dict):'

If I modify the code as below...

def list_formats(self, info_dict):
    formats = info_dict.get('formats', [info_dict])
    #Heres to check that user wants to get links....
    if self.params.get('forceurl', False):
        table = [
            [f['format_id'], f['ext'], self.format_resolution(f), self._format_note(f), f['url']]
            for f in formats
            if f.get('preference') is None or f['preference'] >= -1020]
        
        header_line = ['format code', 'extension', 'resolution', 'note', 'link']
        if len(formats) > 1:
            table[-1][-3] += (' ' if table[-1][-3] else '') + '(best)'
       #Now need to skip of checking 'quiet' option and let it to be printed on output
        self.to_screen(
            '[info] Available formats for %s:\n%s' %
            (info_dict['id'], render_table(header_line, table)))
    else:
        table = [
            [f['format_id'], f['ext'], self.format_resolution(f), self._format_note(f)]
            for f in formats
            if f.get('preference') is None or f['preference'] >= -1020]
        
        header_line = ['format code', 'extension', 'resolution', 'note']
        if len(formats) > 1:
            table[-1][-2] += (' ' if table[-1][-2] else '') + '(best)'
          
        self.to_stdout(
            '[info] Available formats for %s:\n%s' %
            (info_dict['id'], render_table(header_line, table)))

It will give Youtube-dl more ability....

What do you think?
Lets have a cheers, I think.

One more thing: English is not my mother-tongue and I am not much educated, just 10+2. So you may have some problems to understand my words. Sorry for this inconvenience.

Thank you.

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Sep 18, 2018

  1. There is a clean step by step instruction on how to make PRs.
  2. -F and -g are not supposed to be used together in the first place.
  3. To get arbitrary data you must consume the output of --dump-json. You should not change the format of tables.
@dstftw dstftw closed this Sep 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.