Skip to content

Conversation

@asiunov
Copy link

@asiunov asiunov commented Apr 24, 2021

Changes

  • code style fixes
  • fix bug: close opened files
  • use a separate directory for output files
  • support videos protected with a pin code
  • use entity id instead of url
  • exit on keyboard interrupt while running bash scripts
  • fix bug: re-download empty cached parts
  • overwrite a converted file if exists
  • check result video duration
  • fix bug: remove usages of config['mediaData']['records']. I did not get where it comes from, I do not have it in my video configs, please, let me know if this is a special video type that I'm not aware of. I guess it is just an outdated format.

Copy link
Owner

@cleeque cleeque left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your job. Nice MR. Could you please take a look at my comments? Have you tested it on real data?

Comment on lines -40 to +62
if 'records' in self.config['mediaData'] and len(self.config['mediaData']['records']) > 0:
return b64decode(self.config['mediaData']['records'][0]['token']).decode('utf-8')
else:
return b64decode(self.config['mediaData']['token']).decode('utf-8')
return b64decode(self.config['mediaData']['token']).decode('utf-8')
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When records are not available yet, token can be retrieved from 'mediaData' directly. The same works for m3u8 playlist.

--entity TiAR7aDs --pin 123-456-789 --resolution "640x360"
```

If resolution is not specified, the video with a highest one will be dowloaded.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is important.


def __init__(self):
parser = argparse.ArgumentParser(description='boomstream.com downloader')
parser.add_argument('--url', type=str, required=True)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would say url is much readable for the most of the users.

return filenames

def merge_chunks(self, key):
def merge_chunks(self, filenames, key, expected_result_duration):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea with expected_result_duration. Have you tested it on real data?

result_duration = float([line[len("duration="):] for line in result_format.split('\n') if line.startswith("duration=")][0])
print(f"Result duration: {result_duration:.2f}")
print(f"Expected duration: {expected_result_duration:.2f}")
if abs(result_duration - expected_result_duration) > 2:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is nice, but depends on ffmpeg output. Maybe we can make this check optional?

page = open(result_path).read()
else:
r = requests.get(self.args.url, headers=headers)
r = requests.get(f'https://play.boomstream.com/{self.args.entity}', headers=headers, cookies=cookies)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think for user would be easier to copy the URL from browser command line than extracting and copying entity argument manually.

@zikory
Copy link

zikory commented Jun 7, 2023

Hi @asiunov for some reason you code doesn't work currently although much work was done. I am getting errors with decrypting the stream. I've created a small PR to fix the current code here to work. Would have been great to use yours.

@salykin
Copy link

salykin commented Sep 22, 2023

This is an example of how a ton of good fixes have to wait a few review comments forever...
Brothers developers, please, don't push all your fixes at one PR at a time. Use multiple small PRs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants