valtism

valtism

Front end developer with a love for design

Member Since 10 years ago

Pry Financials, Sydney, Australia

Experience Points
27
follower
Lessons Completed
35
follow
Lessons Completed
33
stars
Best Reply Awards
66
repos

259 contributions in the last year

Pinned
⚡ My Personal Resume (for nerds 🤓)
⚡ Personal blog
⚡ Create beautiful collages of your favourite albums
⚡ A react implementation of Ultimate Tic Tac Toe
⚡ Solutions for Advent of Code 2021, in Typescript
Activity
May
19
2 days ago
Activity icon
issue

valtism issue comment yt-dlp/yt-dlp

valtism
valtism

Download speed causes jitter in terminal output

Checklist

  • I'm reporting a bug unrelated to a specific site
  • I've verified that I'm running yt-dlp version 2022.05.18 (update instructions) or later (specify commit)
  • I've checked that all provided URLs are playable in a browser with the same IP and same login details
  • I've checked that all URLs and arguments with special characters are properly quoted or escaped
  • I've searched the bugtracker for similar issues including closed ones. DO NOT post duplicates
  • I've read the guidelines for opening an issue

Description

Encountered while downloading this video: https://www.youtube.com/watch?v=8qP2H1d8XXI

The download indicator in the terminal would jitter horizontally because the speed indicator seems to not be padded to a single size.

You can look at how the issue works in this REPL: https://replit.com/@DanielWood2/yt-dlp-console-speed?v=1 (uses functions from common.py and utils.py)

Actual output
-    0.00B/s -
- 1023.00B/s -
-  1.00KiB/s -
- 999.99KiB/s -
- 1000.00KiB/s -
-  1.91MiB/s -

Expected output
-    0.00B/s   -
- 1023.00B/s   -
-    1.00KiB/s -
-  999.99KiB/s -
- 1000.00KiB/s -
-    1.91MiB/s -

You can see how the current format_speed implementation does not properly pad the output string and leads to jitter on the download output.

Verbose log

[debug] Command-line config: ['-vU', 'https://www.youtube.com/watch?v=8qP2H1d8XXI&t=1810s']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version 2022.05.18 [b14d52355]
[debug] Python version 3.10.4 (CPython 64bit) - macOS-12.3.1-x86_64-i386-64bit
[debug] Checking exe version: ffprobe -bsfs
[debug] Checking exe version: ffmpeg -bsfs
[debug] exe versions: ffmpeg 5.0.1 (setts), ffprobe 5.0.1
[debug] Optional libraries: Cryptodome-3.14.1, brotli-1.0.9, certifi-2021.10.08, mutagen-1.45.1, sqlite3-2.6.0, websockets-10.3
[debug] Proxy map: {}
Latest version: 2022.05.18, Current version: 2022.05.18
yt-dlp is up to date (2022.05.18)
[debug] [youtube] Extracting URL: https://www.youtube.com/watch?v=8qP2H1d8XXI&t=1810s
[youtube] 8qP2H1d8XXI: Downloading webpage
[youtube] 8qP2H1d8XXI: Downloading android player API JSON
[youtube] 8qP2H1d8XXI: Downloading m3u8 information
[youtube] 8qP2H1d8XXI: Downloading MPD manifest
[youtube] 8qP2H1d8XXI: Downloading m3u8 information
[youtube] 8qP2H1d8XXI: Downloading MPD manifest
[debug] Sort order given by extractor: quality, res, fps, hdr:12, source, codec:vp9.2, lang, proto
[debug] Formats sorted by: hasvid, ie_pref, quality, res, fps, hdr:12(7), source, vcodec:vp9.2(10), acodec, lang, proto, filesize, fs_approx, tbr, vbr, abr, asr, vext, aext, hasaud, id
[debug] Default format spec: bestvideo*+bestaudio/best
[info] 8qP2H1d8XXI: Downloading 1 format(s): 301
[debug] Invoking hlsnative downloader on "https://manifest.googlevideo.com/api/manifest/hls_playlist/expire/1652956343/ei/V8iFYvyxN7DnrtoPtauDwAY/ip/2406:3400:209:420:a57d:e93b:ef18:a595/id/8qP2H1d8XXI.1/itag/301/source/yt_live_broadcast/requiressl/yes/ratebypass/yes/live/1/sgoap/gir%3Dyes%3Bitag%3D140/sgovp/gir%3Dyes%3Bitag%3D299/hls_chunk_host/rr2---sn-xmxuxa-ntql.googlevideo.com/force_finished/1/vprv/1/playlist_type/CLEAN/initcwndbps/11860/mh/mW/mm/44/mn/sn-xmxuxa-ntql/ms/lva/mv/m/mvi/2/pl/40/dover/11/pacing/0/keepalive/yes/fexp/24001373,24007246/beids/24153469/mt/1652934272/sparams/expire,ei,ip,id,itag,source,requiressl,ratebypass,live,sgoap,sgovp,force_finished,vprv,playlist_type/sig/AOq0QJ8wRAIgArr3kDOQGMI-yTBV6uZgFg4yozmd1GRJpkVv62sL0YYCIDewBDypkO3N8NvOf_KqXT7ldX0eFBt9VgMyZDs8h78I/lsparams/hls_chunk_host,initcwndbps,mh,mm,mn,ms,mv,mvi,pl/lsig/AG3C_xAwRQIhAIehiD1qGcbPe-MCMIA3AuEz34oaBpU-9prwHDpr4BGtAiBRBNbhy7-evaExp9I3ae-8yHTVgSHS4CiG6pljwNu00w%3D%3D/playlist/index.m3u8"
[hlsnative] Downloading m3u8 manifest
[hlsnative] Total fragments: 2312
[download] Destination: STOP USING CREATE REACT APP - Web Dev Wednesday VOD [8qP2H1d8XXI].mp4
[download]   1.1% of ~530.35MiB at 442.41KiB/s ETA 20:18 (frag 25/2312)
valtism
valtism

As you can see from the actual output listed above, there already is string padding implemented, it is just done so in a broken way. Percentage downloaded is also padded.

I think that it would also be reasonable to limit the size of the speeds (convert 1000.00KiB/s to 1.00MiB/s) to save a character so the spacing doesn't look too big / awkward

Activity icon
issue

valtism issue comment yt-dlp/yt-dlp

valtism
valtism

Download speed causes jitter in terminal output

Checklist

  • I'm reporting a bug unrelated to a specific site
  • I've verified that I'm running yt-dlp version 2022.05.18 (update instructions) or later (specify commit)
  • I've checked that all provided URLs are playable in a browser with the same IP and same login details
  • I've checked that all URLs and arguments with special characters are properly quoted or escaped
  • I've searched the bugtracker for similar issues including closed ones. DO NOT post duplicates
  • I've read the guidelines for opening an issue

Description

Encountered while downloading this video: https://www.youtube.com/watch?v=8qP2H1d8XXI

The download indicator in the terminal would jitter horizontally because the speed indicator seems to not be padded to a single size.

You can look at how the issue works in this REPL: https://replit.com/@DanielWood2/yt-dlp-console-speed?v=1 (uses functions from common.py and utils.py)

Actual output
-    0.00B/s -
- 1023.00B/s -
-  1.00KiB/s -
- 999.99KiB/s -
- 1000.00KiB/s -
-  1.91MiB/s -

Expected output
-    0.00B/s   -
- 1023.00B/s   -
-    1.00KiB/s -
-  999.99KiB/s -
- 1000.00KiB/s -
-    1.91MiB/s -

You can see how the current format_speed implementation does not properly pad the output string and leads to jitter on the download output.

Verbose log

[debug] Command-line config: ['-vU', 'https://www.youtube.com/watch?v=8qP2H1d8XXI&t=1810s']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version 2022.05.18 [b14d52355]
[debug] Python version 3.10.4 (CPython 64bit) - macOS-12.3.1-x86_64-i386-64bit
[debug] Checking exe version: ffprobe -bsfs
[debug] Checking exe version: ffmpeg -bsfs
[debug] exe versions: ffmpeg 5.0.1 (setts), ffprobe 5.0.1
[debug] Optional libraries: Cryptodome-3.14.1, brotli-1.0.9, certifi-2021.10.08, mutagen-1.45.1, sqlite3-2.6.0, websockets-10.3
[debug] Proxy map: {}
Latest version: 2022.05.18, Current version: 2022.05.18
yt-dlp is up to date (2022.05.18)
[debug] [youtube] Extracting URL: https://www.youtube.com/watch?v=8qP2H1d8XXI&t=1810s
[youtube] 8qP2H1d8XXI: Downloading webpage
[youtube] 8qP2H1d8XXI: Downloading android player API JSON
[youtube] 8qP2H1d8XXI: Downloading m3u8 information
[youtube] 8qP2H1d8XXI: Downloading MPD manifest
[youtube] 8qP2H1d8XXI: Downloading m3u8 information
[youtube] 8qP2H1d8XXI: Downloading MPD manifest
[debug] Sort order given by extractor: quality, res, fps, hdr:12, source, codec:vp9.2, lang, proto
[debug] Formats sorted by: hasvid, ie_pref, quality, res, fps, hdr:12(7), source, vcodec:vp9.2(10), acodec, lang, proto, filesize, fs_approx, tbr, vbr, abr, asr, vext, aext, hasaud, id
[debug] Default format spec: bestvideo*+bestaudio/best
[info] 8qP2H1d8XXI: Downloading 1 format(s): 301
[debug] Invoking hlsnative downloader on "https://manifest.googlevideo.com/api/manifest/hls_playlist/expire/1652956343/ei/V8iFYvyxN7DnrtoPtauDwAY/ip/2406:3400:209:420:a57d:e93b:ef18:a595/id/8qP2H1d8XXI.1/itag/301/source/yt_live_broadcast/requiressl/yes/ratebypass/yes/live/1/sgoap/gir%3Dyes%3Bitag%3D140/sgovp/gir%3Dyes%3Bitag%3D299/hls_chunk_host/rr2---sn-xmxuxa-ntql.googlevideo.com/force_finished/1/vprv/1/playlist_type/CLEAN/initcwndbps/11860/mh/mW/mm/44/mn/sn-xmxuxa-ntql/ms/lva/mv/m/mvi/2/pl/40/dover/11/pacing/0/keepalive/yes/fexp/24001373,24007246/beids/24153469/mt/1652934272/sparams/expire,ei,ip,id,itag,source,requiressl,ratebypass,live,sgoap,sgovp,force_finished,vprv,playlist_type/sig/AOq0QJ8wRAIgArr3kDOQGMI-yTBV6uZgFg4yozmd1GRJpkVv62sL0YYCIDewBDypkO3N8NvOf_KqXT7ldX0eFBt9VgMyZDs8h78I/lsparams/hls_chunk_host,initcwndbps,mh,mm,mn,ms,mv,mvi,pl/lsig/AG3C_xAwRQIhAIehiD1qGcbPe-MCMIA3AuEz34oaBpU-9prwHDpr4BGtAiBRBNbhy7-evaExp9I3ae-8yHTVgSHS4CiG6pljwNu00w%3D%3D/playlist/index.m3u8"
[hlsnative] Downloading m3u8 manifest
[hlsnative] Total fragments: 2312
[download] Destination: STOP USING CREATE REACT APP - Web Dev Wednesday VOD [8qP2H1d8XXI].mp4
[download]   1.1% of ~530.35MiB at 442.41KiB/s ETA 20:18 (frag 25/2312)
valtism
valtism

Yes, the floating point moves, and the rest of the string (in this case ETA 20:18 (frag 25/2312)) moves back and forth because the length of the string behind it keeps changing.

Activity icon
issue

valtism issue yt-dlp/yt-dlp

valtism
valtism

Download speed causes jitter in terminal output

Checklist

  • I'm reporting a bug unrelated to a specific site
  • I've verified that I'm running yt-dlp version 2022.05.18 (update instructions) or later (specify commit)
  • I've checked that all provided URLs are playable in a browser with the same IP and same login details
  • I've checked that all URLs and arguments with special characters are properly quoted or escaped
  • I've searched the bugtracker for similar issues including closed ones. DO NOT post duplicates
  • I've read the guidelines for opening an issue

Description

Encountered while downloading this video: https://www.youtube.com/watch?v=8qP2H1d8XXI

The download indicator in the terminal would jitter horizontally because the speed indicator seems to not be padded to a single size.

You can look at how the issue works in this REPL: https://replit.com/@DanielWood2/yt-dlp-console-speed?v=1 (uses functions from common.py and utils.py)

Verbose log

[debug] Command-line config: ['-vU', 'https://www.youtube.com/watch?v=8qP2H1d8XXI&t=1810s']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version 2022.05.18 [b14d52355]
[debug] Python version 3.10.4 (CPython 64bit) - macOS-12.3.1-x86_64-i386-64bit
[debug] Checking exe version: ffprobe -bsfs
[debug] Checking exe version: ffmpeg -bsfs
[debug] exe versions: ffmpeg 5.0.1 (setts), ffprobe 5.0.1
[debug] Optional libraries: Cryptodome-3.14.1, brotli-1.0.9, certifi-2021.10.08, mutagen-1.45.1, sqlite3-2.6.0, websockets-10.3
[debug] Proxy map: {}
Latest version: 2022.05.18, Current version: 2022.05.18
yt-dlp is up to date (2022.05.18)
[debug] [youtube] Extracting URL: https://www.youtube.com/watch?v=8qP2H1d8XXI&t=1810s
[youtube] 8qP2H1d8XXI: Downloading webpage
[youtube] 8qP2H1d8XXI: Downloading android player API JSON
[youtube] 8qP2H1d8XXI: Downloading m3u8 information
[youtube] 8qP2H1d8XXI: Downloading MPD manifest
[youtube] 8qP2H1d8XXI: Downloading m3u8 information
[youtube] 8qP2H1d8XXI: Downloading MPD manifest
[debug] Sort order given by extractor: quality, res, fps, hdr:12, source, codec:vp9.2, lang, proto
[debug] Formats sorted by: hasvid, ie_pref, quality, res, fps, hdr:12(7), source, vcodec:vp9.2(10), acodec, lang, proto, filesize, fs_approx, tbr, vbr, abr, asr, vext, aext, hasaud, id
[debug] Default format spec: bestvideo*+bestaudio/best
[info] 8qP2H1d8XXI: Downloading 1 format(s): 301
[debug] Invoking hlsnative downloader on "https://manifest.googlevideo.com/api/manifest/hls_playlist/expire/1652956343/ei/V8iFYvyxN7DnrtoPtauDwAY/ip/2406:3400:209:420:a57d:e93b:ef18:a595/id/8qP2H1d8XXI.1/itag/301/source/yt_live_broadcast/requiressl/yes/ratebypass/yes/live/1/sgoap/gir%3Dyes%3Bitag%3D140/sgovp/gir%3Dyes%3Bitag%3D299/hls_chunk_host/rr2---sn-xmxuxa-ntql.googlevideo.com/force_finished/1/vprv/1/playlist_type/CLEAN/initcwndbps/11860/mh/mW/mm/44/mn/sn-xmxuxa-ntql/ms/lva/mv/m/mvi/2/pl/40/dover/11/pacing/0/keepalive/yes/fexp/24001373,24007246/beids/24153469/mt/1652934272/sparams/expire,ei,ip,id,itag,source,requiressl,ratebypass,live,sgoap,sgovp,force_finished,vprv,playlist_type/sig/AOq0QJ8wRAIgArr3kDOQGMI-yTBV6uZgFg4yozmd1GRJpkVv62sL0YYCIDewBDypkO3N8NvOf_KqXT7ldX0eFBt9VgMyZDs8h78I/lsparams/hls_chunk_host,initcwndbps,mh,mm,mn,ms,mv,mvi,pl/lsig/AG3C_xAwRQIhAIehiD1qGcbPe-MCMIA3AuEz34oaBpU-9prwHDpr4BGtAiBRBNbhy7-evaExp9I3ae-8yHTVgSHS4CiG6pljwNu00w%3D%3D/playlist/index.m3u8"
[hlsnative] Downloading m3u8 manifest
[hlsnative] Total fragments: 2312
[download] Destination: STOP USING CREATE REACT APP - Web Dev Wednesday VOD [8qP2H1d8XXI].mp4
[download]   1.1% of ~530.35MiB at 442.41KiB/s ETA 20:18 (frag 25/2312)
May
17
4 days ago
push

valtism push valtism/unsong-contentlayer

valtism
valtism

Add font size buttons

Add padding for mobile

commit sha: d791879a167fb12e0cd946c244ee3fab95772cb1

push time in 4 days ago
May
16
5 days ago
Activity icon
created branch
createdAt 5 days ago
May
11
1 week ago
Activity icon
issue

valtism issue comment pd4d10/vite-plugin-svgr

valtism
valtism

Request: Add a changelog or use GitHub releases

I'd like to know what has changed in recent versions, to decide whether I should update.

valtism
valtism

Agreed. Especially concerning with major version updates and not knowing what the breaking changes are.

Activity icon
issue

valtism issue contentlayerdev/website

valtism
valtism

Gitpod Getting Started example not working

Tested in MacOS Safari and Chrome. Returns the error Couldn't parse context 'https:/github.com/contentlayerdev/next-contentlayer-example'.

Activity icon
issue

valtism issue comment contentlayerdev/contentlayer

valtism
valtism

Gitpod Getting Started example not working

Tested in MacOS Safari and Chrome. Returns the error Couldn't parse context 'https:/github.com/contentlayerdev/next-contentlayer-example'.

valtism
valtism

This at the top of the Getting Started page: https://www.contentlayer.dev/docs/getting-started in the "Try It Now" box

push

valtism push valtism/tailwindcss.com

valtism
valtism

Update divide color examples

valtism
valtism

Update divide opacity examples

valtism
valtism

Update divide style example

valtism
valtism
valtism
valtism

Merge branch 'next' of github.com:tailwindlabs/tailwindcss.com-next into next

valtism
valtism

tweak "ready-made components" animation

valtism
valtism

Update background color examples

valtism
valtism

Update background opacity examples

valtism
valtism

Update background clip examples

valtism
valtism

Update background image examples

valtism
valtism

Update gradient color stops examples

valtism
valtism

Merge branch 'next' of github.com:tailwindlabs/tailwindcss.com-next into next

valtism
valtism

Add compatibility build docs

valtism
valtism

Update search and progress styles

valtism
valtism

Make version switch to v1 work, link home page tiles

valtism
valtism

Update box shadow examples

valtism
valtism
valtism
valtism
valtism
valtism

commit sha: d0a2da7695ce08ac658bb056f3104904600f8a13

push time in 1 week ago
May
8
1 week ago
Activity icon
issue

valtism issue contentlayerdev/contentlayer

valtism
valtism

Gitpod Getting Started example not working

Tested in MacOS Safari and Chrome. Returns the error Couldn't parse context 'https:/github.com/contentlayerdev/next-contentlayer-example'.

May
3
2 weeks ago
pull request

valtism pull request tailwindlabs/tailwindcss.com

valtism
valtism

Add note on exclusion glob patterns

As someone who is not familiar with glob patterns, I just spent a good chunk of time trying to figure out if excluding patterns was possible. It doesn't mention it anywhere in the tailwind documentation, so I thought it would be a good idea to add it here as a small note for posterity.

push

valtism push valtism/tailwindcss.com

valtism
valtism

Add note on exclusion glob patterns

As someone who is not familiar with glob patterns, I just spent a good chunk of time trying to figure out if excluding patterns was possible. It doesn't mention it anywhere in the tailwind documentation, so I thought it would be a good idea to add it here as a small note for posterity.

commit sha: 78cf7a9cd17e71847e715599a002f7c3a0a5df89

push time in 2 weeks ago
Activity icon
created branch
createdAt 2 weeks ago
Activity icon
created repository
createdAt 2 weeks ago
Activity icon
issue

valtism issue comment tailwindlabs/headlessui

valtism
valtism

Export component prop types

What package within Headless UI are you using?

@headlessui/react

What version of that package are you using?

v1.5.0

What browser are you using?

N/A

Reproduction URL

N/A

Describe your issue

In React + Typescript, a common pattern I follow is to wrap a library component for styling or custom behaviour before exposing it to the rest of the codebase. I like to mirror the underlying component props so that Typescript intellisense can provide the same prop hints to for the wrapper component as the underlying library component.

Here is an example of what I want:

// Wrapping a tab for custom styling. TabProps, however, does not exist;
function TemplateLibraryTab({ children, ...props }: TabProps) {
  return (
    <Tab
      {...props}
      className={({ selected }) =>
        clsx("p-2 rounded", selected ? "text-gray-900" : "text-gray-500")
      }
    >
      {children}
    </Tab>
  )
}

HeadlessUI does not seem to expose these props, or at least I could not find them. Would it be possible to export these prop types for this purpose? I think it is a strong use-case.

valtism
valtism

I should point out that there is a workaround for this. You can use React.ComponentProps to pull out the type from the component.

function TemplateLibraryTab({ children, ...props }: React.ComponentProps<typeof Tab>) {
  return (
    <Tab
      {...props}
      className={({ selected }) =>
        clsx("p-2 rounded", selected ? "text-gray-900" : "text-gray-500")
      }
    >
      {children}
    </Tab>
  )
}

This works in this use-case, but I have run into issues with it in the past. I still think that exporting prop types like other libraries is a good thing to have.

Activity icon
issue

valtism issue tailwindlabs/headlessui

valtism
valtism

Export component prop types

What package within Headless UI are you using?

@headlessui/react

What version of that package are you using?

v1.5.0

What browser are you using?

N/A

Reproduction URL

N/A

Describe your issue

In React + Typescript, a common pattern I follow is to wrap a library component for styling or custom behaviour before exposing it to the rest of the codebase. I like to mirror the underlying component props so that Typescript intellisense can provide the same prop hints to for the wrapper component as the underlying library component.

Here is an example of what I want:

// Wrapping a tab for custom styling.
// TabProps, however, does not exist. I would have to write out each prop manually for typing this component.
function TemplateLibraryTab({ children, ...props }: TabProps) {
  return (
    <Tab
      {...props}
      className={({ selected }) =>
        clsx("p-2 rounded font-medium", selected ? "text-gray-900 bg-gray-200" : "text-gray-500")
      }
    >
      {children}
    </Tab>
  )
}

HeadlessUI does not seem to expose these props, or at least I could not find them. Would it be possible to export these prop types for this purpose? I think it is a strong use-case.

May
2
2 weeks ago
push

valtism push valtism/votey

valtism
valtism

Add prisma

Change file structure

commit sha: ebc08ea0760b9b66054ab6f3993a793f956d6895

push time in 2 weeks ago
Activity icon
created branch

valtism in valtism/votey create branch main

createdAt 2 weeks ago
Activity icon
created repository

valtism in valtism/votey create repository

createdAt 2 weeks ago
Apr
17
1 month ago
started
started time in 1 month ago
Apr
5
1 month ago
Previous